site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jan 20, 2005, at 2:58 PM, Nat! wrote: Am 19.01.2005 um 19:42 schrieb Nat!: -Eric _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I'd like to do the following. In my library code I want to get a list of all threads of my process and the thread I am currently in myself (pthread_this()). What I then want to do is suspend all the other threads, do a little processing and then resume all the other threads. The general idea is something akin to a "full garbage collection". The effect would be a process-wide mutex without the mutex. Well the replies I got privately say, that you can't do that in Darwin. You can probably get the lists of threads, but the suspension of a related thread in the same process is not supported. That wraps up this mail thread. When I worked for Microsoft we needed to do something similar as part of the shared source CLI. You can download the source code at <http://msdn.microsoft.com/net/sscli/> if you want, but the quick summary is that you can use the Mach thread_suspend and thread_resume functions to do this. To get a Mach thread ID from a pthread, call pthread_mach_thread_np. Technically this isn't supported (as is true for most of the Mach functions), but it's worked fine on every Mac OS X release I've used and I imagine it's likely to continue to work. This email sent to site_archiver@lists.apple.com