C
Carl Rosenberger
Hi all,
our system consists of two threads:
(1) Main thread
does all the interaction with user application code
(2) Communication thread
is responsible for client/server communication
Whenever the Main thread (1) needs an instant reply from the server
- thread (1) places a message in the outgoing message queue
- thread (1) starts to wait
- thread (2) sends all outgoing messages to the server
- thread (2) places all available server messages into the
incoming message queue
- thread (2) sends a notify (Monitor.Pulse() to thread (1),
if there are new incoming messages
- thread (1) takes the message from the incoming message
queue and continues it's work.
How would I implement the above in the most efficient way
in CF, without switching to a synchronous mechanism?
Is there an alternative to using Thread#Sleep() and polling?
Thanks in advance for any hints.
Kind regards,
Carl
our system consists of two threads:
(1) Main thread
does all the interaction with user application code
(2) Communication thread
is responsible for client/server communication
Whenever the Main thread (1) needs an instant reply from the server
- thread (1) places a message in the outgoing message queue
- thread (1) starts to wait
- thread (2) sends all outgoing messages to the server
- thread (2) places all available server messages into the
incoming message queue
- thread (2) sends a notify (Monitor.Pulse() to thread (1),
if there are new incoming messages
- thread (1) takes the message from the incoming message
queue and continues it's work.
How would I implement the above in the most efficient way
in CF, without switching to a synchronous mechanism?
Is there an alternative to using Thread#Sleep() and polling?
Thanks in advance for any hints.
Kind regards,
Carl