This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]