This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
adding a second notify to the fork and clone observers
- From: Andrew Cagney <cagney at redhat dot com>
- To: Sami Wagiaalla <swagiaal at redhat dot com>, Phil Muldoon <pmuldoon at redhat dot com>
- Cc: frysk <frysk at sources dot redhat dot com>
- Date: Sat, 08 Apr 2006 13:20:52 -0400
- Subject: adding a second notify to the fork and clone observers
Sami, Phil,
While working on getting frysk to automatically detach from a new
unobserved child process (created via fork) I had the chance to look
again over the fork and clone observer methods.
At present they have a single notify method of the form:
Action updateForked (Task parent, Task child);
that's called when the parent's fork event occurs. If it blocks the
parent, it also blocks the child as a side effect. I'd like to suggest
two changes:
- rename updateForked to updateForkedParent and have it only block the
parent task
- adding a second method like:
Action updateForkedChild (Task parent, Task child)
called when the child is ready and it blocks just the child.
(I'm not sure if Sami and I discussed this before).
By having the two separate interfaces:
- blocking the child is separate and explicit (and can be done
independent of the parent)
- there's clear and explicit point at which the child is in a state
where it can be manipulated
Of course cascading code would need to be modified. The new code would
look like:
updateForkedParent
return CONTINUE
updateForkedChild
child.requestAddObserver...
child.requestUnblock (this)
return BLOCKED
thoughts?
Andrew