Boost logo

Boost Users :

From: acarsac acarsac_at_[hidden])
Date: 2002-12-17 07:42:06


<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).

in fact you need one unique thread that read message from queue
and dispatch it to the other specialized thread according to the
founded type.

no problem of critical section (2 thread access the same message in
queue)in that design.


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