Threads in C++
Okay here's the deal. I'm thinking of creating an IRC client, but the thing is.. i don't know what to use or how to make it so that it's waiting for incoming messages from the server AND sending whatever i type in at the same time. Any input is appreciated.. thanks :)
CodePeople <-- if($needhelpwith=="programming") visit(codepeople);[
in response to the title,
Re: Threads in C++
Thanks a bunch.. do you know where i can read up on that function?
if you have MSVC use the MSDN, borland builder has a library that has it.
if you don't have those,
unsigned long _beginthread( void( __cdecl *start_address )( void * ), unsigned stack_size, void *arglist );
Start address of routine that begins execution of new thread
Stack size for new thread or 0
Argument list to be passed to new thread or NULL
used to terminate the thread created by begin thread.
use them like so
this shuld print the value of counter ten times
int counter = 0;
// this functio must be declaread in this format void myfunc(void*)
void ThreadFunc(void* v)
while(counter < 10000);
_endthread(); // must be called to cleanup after thread
bool done = false;
// do not include the parentheses when passing the function to beginthread