DMD 1.022 and 2.005 releases - what's wrong with threading?

downs default_357-line at yahoo.de
Sat Oct 6 22:07:09 PDT 2007


David Brown wrote:
> On Sun, Oct 07, 2007 at 05:36:08AM +0200, downs wrote:
> 
>>> The threading package in Phobos is not very good, as it is based on my
>>> very poor understanding of the problem. Drop kicking std.thread is
>>> certainly open for discussion for v2. I wouldn't shed a tear for it <g>.
>>
>> Maybe I'm missing something here; maybe it's because Phobos' threading
>> is all I ever used, but what's wrong with it?
>> I mean, it's threads .. you can start them, halt them, run stuff in them
>> .. what more is needed? It's a very basic implementation, very close to
>> the OS; but thanks to synchronized, I generally found it easy to add the
>> primitives I needed.
> 
> I don't know much (if anything) about threading on Windows, but the Linux
> threading code is not really all that useful.  Without either reaching
> under the hood or bypassing D's synchronized entirely, there is no way to
> even build the right primitives to get to condition variables, so
> synchronization isn't even possible.  It is possible to create independent
> threads that do separate things, but not to have them really interact with
> each other.
> 

I think the problem is that people get so used to their favorite
threading primitives that they  believe synchronization and multiple
threads working together is entirely impossible without them.
As somebody who has written multithreaded programs using exclusively D's
and Phobos' threading primitives, let me assure you that it is very much
possible :)

With that in mind, I'd kindly ask you to describe some basic, common
situation that you believe is outright impossible to do with Phobos'
threading, because I honestly can't see any.

Thanks in advance :)
 --downs, Phobos fanboy



More information about the Digitalmars-d mailing list