This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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] | |
On Mon, 2004-12-13 at 18:17, Bryce McKinlay wrote:In the current code, there isn't a separate "mediator" thread - any user thread which the GC happens to run in will try to call pthread_kill to suspend the other threads.
It would be interesting to know how these other VMs solved the issue.
Mediator pattern. The mediator still runs with the appropriate
privileges. I guess GCJ already has a mediator which iterates through
the list of threads and stops each of them when the user-thread's GC
wants to run. The only thing that seems to fail is the command that the
user-thread's GC sends to the mediator.
That wouldn't work, because pthread_cond_signal() won't interrupt a thread that isn't actually waiting on the right condition variable. You'd still have to either use pthread_kill() or have the compiler insert interrupt points at each basic block edge. The later would have a performance effect and would be tricky to implement in the presence of blocking IO, etc.Is there is another IPC mechanism with the necessary semantics - ie able to suspend any thread at any time, asynchronously?
I think this should not be necessary. The mediator waits for commands anyway, so a simple pipe would be sufficient. Even a condition variable will work. So we only have to change the pthread_kill() into a pthread_cond_signal()
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |