OK, guys, I have another issue I want input on. When child SMs terminate they have to notify their parent. The parent has to wait for all the children to terminate. So I've been thinking to use the job subsystem for this: the parent would post a job to wait for N children,
and each child would post a job, the last one releasing the parent.

Now I see two ways to implement this - one is to implement this directly in the state machine code. The parent simply stops running (because it does not schedule a job yet returns DEFERRED). Each child decrements a counter, and when it hits 0 the parent is restarted. This is a little ugly because the waiting parent is not being held on any list or queue (up to now all waiting SMs are in the job subsystem), also the last terminating child becomes the parent as it starts executing the parent code. Things can get weird when one SM starts children that start children, and so on.

Now the other way to implement this is with the job subsystem as I suggested above. Much cleaner except for one thing: up to now the state machine subsystem has had no dependency at all on the job subsystem. If we do it this way, this function only works with the job system intact. I'd prefer not to do this, but it does seem the cleanest, most logical means.

Comments?

Walt
--
Dr. Walter B. Ligon III
Associate Professor
ECE Department
Clemson University
_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to