Mixed Sync/Async communications pattern



I have a problem that I am sure someone has solved before, and I am
looking for a pointer
to example code or any reference to a standard solution.

Application A sends commands to B.
Some commands do not require a response from B, and some do, but I
know ahead of the time
which are which. Commands that require a response, should not return
to their caller in A,
because inevitably, the response is needed in the next line of code.

Application B sends responses back to A, but can also send async
events, as the user
interacts with B.

Async events from B can in turn cause one or more commands from A to
B, and B might
in turn fire off a sync reply, and one or more further async requests
as it executes A's commands.

This typically occurs when the user request an object to be created at
location X, and the
mouse is 'over' location X, and the object to be constructed fires off
'mouseOver' events,
which in turn.......

The combination of fileevent...readable and vwait varname cannot
handle the situation
100 % of the time

My thinking at the moment revolves around a FIFO queue of expected
responses, but
someone may already have solved the problem.

Any pointers ?

Dave

.



Relevant Pages

  • [patch 2/3] s390: add vmcp interface.
    ... Add interface to issue VM control program commands. ... * the caller of __cpcmd has to ensure that the response buffer is below 2 GB ... +static int vmcp_open ...
    (Linux-Kernel)
  • Re: Adventures in Proofing Pt 2
    ... rock-solid recalls (and the immediate and correct response to ... commands) are directly related to how much time and effort a dog's ...
    (rec.pets.dogs.behavior)
  • Re: Null Pointer Exception
    ... > Thank you for the response; ... I can't seem to get away from the Null Pointer Runtime ... >> marks:~ mehaase$ javac Test.java ...
    (comp.lang.java.help)
  • Re: intel-hda sound too quiet in linux-2.6.25-rc6
    ... Thank you for your quick response. ... % amixer set Master unmute 80% ... These commands give me approximately the old ...
    (Linux-Kernel)
  • Re: Alternatives to Application.DoEvents?
    ... The main thread is blocked until a response is received or there ... Each application request may ... > execute many different commands to the device. ... >>> still have to poll the status of the async method in order to block ...
    (microsoft.public.dotnet.languages.vb)