|
-
March 10th, 2009, 08:43 AM
#1
Implementing queue as a class and threads
Hi all,
my requirement is there is a function which creates one thread and passes the data for further processing which looks like
void MyFunc(char *data)
{
CreateThread(NULL,0,build_data,(void *)data,0,NULL);
}
Now i want to modify the above code.
I want to introduce a queue class and want to create two threads so that 1st thread can invoke a function which writes the data to the queue and the 2nd thread reads the data from the queue. Please introduce mutex if required.
Can you tell me how to implement the above in VC++.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|