The notifier is a task that waits on events.
It has two features
FOREVER {
AwaitEvent( );
Send( master );
}
FOREVER {
Receive ( *requester );
AwaitEvent( );
Reply ( requester );
}
Does this ever make sense?
In an application there is likely to be lots of waiting on combinations of events.
We use the detective to discover that an event has occurred.
Code could be
FOREVER {
Send( part1 );
Send( part2 );
...
Send( master );
}
Code above doesn't work! Try instead
FOREVER {
Receive( *requester, request );
if ( request.type == CLIENT ) {
parse( request );
if ( happened( parsedRequest, DB ) ) Reply( requester );
else enQueue( request );
}
else if (request.type == NOTIFICATION ) {
updateDB ( request );
Reply( requester );
foreach ( queuedClient ) if ( happened( parsedRequest, DB ) ) Reply( client );
}
}
This is the code of a detective.
We can say that an event has not happened yet.
Only at the end of the universe can we say that an event simply has not happened.
Time-outs are needed for NOT
Who is the client of the detective
Not multually exclusive
Examples
Kernel can detect such things
Possible send-blocking can be detected at compile time
Solutions
Resource contention
Example
Kernel cannot easily detect this
Possible solutions
Could consider this a form of critical race.
A unique task that is licensed to execute Destroy
Destory/Create is a common way to resolve malfunctions
Reset if a more efficient alternative.
Return to: