Re: Is Message passing good approach for multi-threaded applications?



On Jul 21, 8:55 am, Behzad <Sedighza...@xxxxxxxxx> wrote:
hi all,

I am currently developing an embedded protocol converter.In this
application there are 16 serial ports and 2 Ethernet ports.There are
16 threads for each serial port and also there is a network server
which accepts connections from LAN. so there is a thread per each
connection.There are also some threads for other tasks like
application management, time synchronization etc. As a solution to the
problem of communication between these threads i choose message
passing.There are 2 queues.One for requests and one for responses. LAN
threads put messages into request queue and other threads put replies
into response queue. Because our system has a CPU with 500MHz speed
(ARM9)  i was concern if this approach can satisfy our
requirement.Each request and subsequent response should take only 200
ms. Does this architecture ( message passing as a communication bus )
good or there are some other approaches? Any guide,URL, book,
experience would appreciated.

Thanks in advance
Behzad

Message passing is a fine abstraction. However using only 2 queues to
pass all messages among all 300 or so threads may well cause queue
synchonization to be the system bottleneck. Think about ways to
increase the number of queues, for example by using one input queue
per thread with a separate dispatcher to assign requests in a smart
way.

.



Relevant Pages

  • Re: Thread Question
    ... I added some dummy code to simulate long-running requests, ... from Queue import Queue ... Thread's name into the response Queue. ...
    (comp.lang.python)
  • Re: Is Message passing good approach for multi-threaded applications?
    ... application there are 16 serial ports and 2 Ethernet ports.There are ... passing.There are 2 queues.One for requests and one for responses. ... into response queue. ... requirement.Each request and subsequent response should take only 200 ...
    (comp.os.linux.misc)
  • Re: Thread Question
    ... Thread's name into the response Queue. ...     Get items from the request Queue, ... # Queue up the requests. ...
    (comp.lang.python)
  • Re: Thread Question
    ... going to only download three requests at a time and if one of ... the requests takes a long time it will hold up all the others. ... def run(request, response): ... requestQueue = Queue ...
    (comp.lang.python)
  • Re: Thread Question
    ... This is the first time I'd be doing threading. ... requests all in parallel). ... def run(request, response): ... requestQueue = Queue ...
    (comp.lang.python)