17 Dec
2002
17 Dec
'02
12:42 p.m.
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.