IPC Timeouts
Jonathan S. Shapiro
shap at eros-os.org
Thu Feb 24 15:53:55 CET 2005
On Thu, 2005-02-24 at 12:58 +0100, Espen Skoglund wrote:
> A reason why timeouts are currently specified within the IPC is that
> doing so enables a program to invoke an IPC and set a timeout in one
> atomic operation.
Just to expand on what Espen is saying, this issue is very real. In
EROS, the issue is implemented differently. An application that needs
such a timeout has a "watchdog thread" (I am translating approximately
into L4 terminology).
The timed IPC executes
watchMe := true /* shared memory */
doIPC()
watchMe := false
cancelTimer(wait-object)
The watchdog thread executes
call(wait-object, timeout)
if (watchMe)
"stun" the main thread
if the main thread is in the receiving state,
set an error code and advance the PC
else
do nothing
Yes, this is complex, but remember that this case is really very very
rare.
I'm not sure if this is useful to the L4 discussion, but perhaps it will
suggest other solutions that may have appeal.
More information about the l4-hackers
mailing list