Boost logo

Boost Users :

From: olivier_debels olivier_debels_at_[hidden])
Date: 2002-12-17 05:23:06


--- In Boost-Users_at_[hidden], Albrecht Fritzsche
<albrecht.fritzsche_at_t...> wrote:
> olivier_debels wrote:
> > msg* pop()
> > {
> > // Get next message out of the queue
> > // While no message found
> ^^^
> > // Check if no other thread is working on such a
messagetype
> > // If not -> return this message
> > // else -> get next message
> > }
> >
> > To check if no other thread is working on such a messagetype, we
> > take a look in the map(threadId, message type).
>
> But still, what buys you the threadId? if you would change the
check to
>
> Check if noone is working on such a messagetype
>
> and possibly use a set<message_type>, what is missing than?
>
> Ali

I need to know when a message finishes too. So when doing a pop(),
I first adjust the map (remove the type this thread was working on).

If I just have a set<message_type> and a thread wants to pop another
message, I don't know any more which one has finished before. In
other words, when do I remove a type out of the set?

Maybe I could do this in the destructor of message however, but this
seems a bit ugly no?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net