thread safe class - queue of objects

Hi Guys,

I am new to C++ programming and i have a small assignment.

Can somebody help me with code on how to implement a thread safe class to manage a queue of objects.Accessing the front of the queue should be a blocking operation when the queue is empty.

Thanks,
Rishi
How do you want us to help?
Hi,

Can someone give me some hints about how i can solve this problem.

The last time i have code with C++ was about 12 years back. I have been working with pl/sql since then. I have apply for a new job and they give this small assignment to solve on C++.

I will need some time to get familiar with C++ again.but right now i dont have this time.

Can anybody help me
Actual blocking, as in deferring processor time to another thread, is done by giving the class a static member that is either a mutex or a critical section. How you do this specifically depends on the libraries you are allowed to use. Are you supposed to write the container class as well?
Thanks.

I can use any libraries i want.

If there is enough time, i can write the container class as well but it s not mandatory.
Topic archived. No new replies allowed.