Maybe I'll just clarify as to what I meant by this title:
Suppose I have a program named MyProg.java like this:
Code:
import java.lang.*;
class myThread extends Thread
{
public void run()
{
SiblingThreadOne.start();
SiblingThreadTwo.start();
.
.
.
SiblingThreadN.start();
}
}
class MyProg{
public static void main(String args[])
{
//Scheduler switching between threads
//[ParentThread1, ParentThread2, myThread, OtherParentThreads...]
}
}
//go on to define parent threads
//and sibling threads
What I want to do is when myThread does a context-switch, the sibling threads are suspended as well. When the scheduler does a context-switch back to myThread, the sibling threads resume. The idea is to allow another developer to write a thread with siblings threads, compile it, and then plug it back into the program without his sibling threads coming into conflict with the parent threads, sibling threads, and functions of other developers.
Any help would be appreciated. Just something I'm trying to figure out. I honestly don't know if it's even possible unless there is some kind of callback function (or something) for the thread on a context-switch.
Thanks!