views:

62

answers:

2

I would like to implement a thread safe queue in VS 6.0
Is there a good class to use for this? This is an MFC application using the CWinApp.

My former post lead me to here but I don't have the luxury to code in VS 2010, stuck in 6.0 land.
o well.....

Thank You.

+1  A: 

Obviously you accepted the wrong answer to that question! :-) The code I linked in my answer will work fine with VC++ 6.

Jerry Coffin
Ahh man! Sorry about that, well it could be the right answer for someone else...haha o well. I will look into your code with more detail. thank You.
Tommy
@Tommy: No biggie. You're obviously fairly new, so you haven't yet realized that anytime I give an answer, accepting it should be automatic! ;-)
Jerry Coffin
+1  A: 

A thread safe queue shouldn't be particularly difficult to implement yourself. Just use a std::deque inside a wrapper class and then provide the access you want i.e. push(), pop(), front() etc. For C++ concurrency you should definitely go for boost::thread use mutexes to appropriately protect the parts of the queue that need it. I think this is a worthwhile endeavour and you will learn a lot about concurrency at the same time.

radman