[Gc] PARALLEL_MARK broken in Windows 7+ (SignalObje ctAndWait no longer atomic)
Ivan Maidanski <ivmai-JGs/[email protected]> Mon, 26 May 2014 23:17:56 +0400
| Newsgroups | gmane.comp.programming.garbage-collection.boehmgc |
|---|---|
| Message-ID | <[email protected]> |
Hi, It turned out that multi-core marker based on NT SignalObjectAndWait is broken in Windows 7 or later leading to a deadlock. (Does anyone use PARALLEL_MARK without DONT_USE_SIGNALANDWAIT on Windows?). The reason is that SignalObjectAndWait no longer atomic - "Note that the "signal" and "wait" are not guaranteed to be performed as an atomic operation. Threads executing on other processors can observe the signaled state of the first object before the thread calling SignalObjectAndWait begins its wait on the second object.Use extreme caution when using SignalObjectAndWait and PulseEvent with Windows 7, since using these APIs among multiple threads can cause an application to deadlock." [1] But at the time SignalObjectAndWait-based solution for GC parallel marker was developed [3], MSDN 2008 said "SignalObjectAndWait atomically signals one object and waits on another one" [2]. Is there any option to fix SignalObjectAndWait-based solution? The easy alternative to remove it and always use backup solution (DONT_USE_SIGNALANDWAIT) on Windows based on using own manually-reset Event for each marker [4] (probably, the solution could be slightly optimized). Links: [1] http://msdn.microsoft.com/en-us/library/windows/desktop/ms686293%28v=vs.85%29.aspx [2] https://docs.google.com/file/d/0B3exyGGpaHAeNjM4NGIwM2YtOTM5Ni00YmQ2LTk5YmEtOWY5NjRmYmY2NDcy/edit?pli=1 [3] https://github.com/ivmai/bdwgc/commit/f1b257a662a99c5ee25b1ea6449a5488439a64b7 [4] https://github.com/ivmai/bdwgc/commit/c5484327f821420dc0bfb40d35cca81ceb863512 Regards, Ivan _______________________________________________ bdwgc mailing list [email protected] https://lists.opendylan.org/mailman/listinfo/bdwgc