Subj : Re: posix and lock-free algorithms To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Thu Aug 04 2005 06:24 pm Joe Seigh writes: > You can see what's Java currently says about this sort of > optimization. I know an early Java compiler optimized out empty > synchronized blocks and later had to fix it. But I don't know if > it's allowed with current Java semantics. If Posix does go with > formal semantics it's likely to be similar to Java. At some time I will want to give more formal semantics for multithreading in my language. I don't know however where is a good compromise between usefulness and implementability in these areas. I mean memory synchronization, which operations should be intrinsically atomic or synchronized, or what should be a permitted behavior when synchronization is missing. The spirit of the language is most close to Scheme or Dylan. That is, dynamically typed, mostly functional, garbage collected, safe (no undefined behavior), preferring expressivity to efficiency, variables hold pointers to objects only (at least conceptually). For thread synchronization I have mutexes and conditions, and some constructs which behave as if they used mutexes and conditions internally (e.g. lazy variables). My current implementation of threads dispatches them in a single OS thread (except that separate OS threads are used for background tasks not interfering with the runtime). But I want to make the design implementable using OS threads too, e.g. on .NET. Reacting to asynchronous signals would be problematic with other implementations of threads, but I will leave it to later. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .