Thread overview | |||||
---|---|---|---|---|---|
|
March 31, 2006 Semaphores and the GC. | ||||
---|---|---|---|---|
| ||||
Both windows and linux semaphores will not work correctly in the presence of the GC when it 'stops and restarts' the world (or at least I've not been able to get something working). The problem appears to be from pausing and/or resuming threads. I've tried all of native POSIX semaphores and pthread mutex/conditions on Linux, and Windows API Semaphores. They all work up and until a GC happens or threads are paused and resumed in some other way. Anyone out there have any ideas on how to implement POSIX semaphore-like functionality that will work w/ the GC? Thanks, - Dave |
March 31, 2006 Re: Semaphores and the GC. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave | On linux, if you use semaphores. The GC sends SIGUSR1 & SIGUSR2 to all threads for pausing and resuming. The semaphores will wake up with error EINTR. You only have to check for that, and wait again. |
March 31, 2006 Re: Semaphores and the GC. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frank Benoit | Frank Benoit wrote:
> On linux, if you use semaphores.
> The GC sends SIGUSR1 & SIGUSR2 to all threads for pausing and resuming.
> The semaphores will wake up with error EINTR. You only have to check for
> that, and wait again.
Sounds like a good reason to provide a wrapper for semaphores in D.
Sean
|
Copyright © 1999-2021 by the D Language Foundation