Thread Pooling
kris
foo at bar.com
Sun Apr 23 18:14:47 PDT 2006
Craig Black wrote:
> "kris" <foo at bar.com> wrote in message
> news:e2gtv3$1oqh$1 at digitaldaemon.com...
>
>>Craig Black wrote:
>>
>>>>I've considered this as well. In fact, I've got library code to do this
>>>>for C++. But I'd prefer something a bit more forward-looking for D (see
>>>>Herb Sutter's Concur project for one possibility). I'm planning to
>>>>address this need at some point in Ares, probably in a manner similar to
>>>>the Concur design, but I don't have time at the moment.
>>>
>>>
>>>I don't see syntax this high-level to be implementable in a library. It
>>>seems like this would require features to be added to the language core.
>>>Or do you disagree?
>>>
>>>-Craig
>>
>>Are you thinking of Occam-style 'par' and 'alt' constructs, or something
>>different?
>
>
> I don't know anything about "Occam" (Objective caml?) so I can't comment on
> that. Concur is an experimental research project in search high-level
> language constructs for C++ that provide safe and efficient parallelism. I
> can give you a brief tutorial but it's probably best look it up on the net.
Ah. I'd interpreted your response to Sean as being something other than
Concur; but it's now clear you were talking about the same thing. Occam
is a language designed in the 80's specifically for wildly concurrent
machine-architectures. The hardware and language were designed to
reflect each other (concurrently <g>) and, at the time, Occam and the
Transputer were truly awesome advances. Made it almost trivial to build
hypercubes, backed with uber-fast crossbar routing-switches. Just never
took off in the mainstream -- probably ahead of their time :) -- and
INMOS died a horrible death.
http://en.wikipedia.org/wiki/Occam_programming_language
http://en.wikipedia.org/wiki/Transputer
(the venerable "Connection Machine" was not Transputer based, but the
concepts were very similar)
>
> With Concur language features, there is no more dealing with threads and
> locks. The first example presented is the notion of an "active" class,
> which is a class where each object instance conceptually runs on its own
> thread.
>
> active class C {
> void foo() { ... }
> }
>
> void main()
> {
> active C c;
> c.foo(); // call is nonblocking
> ... // this code can execute in parallel with c.f()
> }
>
[snip]
Reading the PARC slides, Concur looks quite like a rehash of Occam
constructs? Sutter talks about the FIFO approach to method invocation
(via message passing), whereas Occam/transputer used "channels" for such
things -- including "future" values and so on -- all backed in hardware
(with the physical channels looking more than a bit like the
multi-hypertransport busses of today). As you can see from the above
links, PAR and ALT provided for efficient and granular control over
concurrency.
Occam is long since dead, but the ideas and implementation were
ground-breaking. Certainly worthy of a look in this regard?
And, I agree completely -- it would be awesome if D were to excel in
this arena; perhaps the biggest sea-change in programming strategy we're
likely to see. Any language that can ride that wave will garner a whole
lot of attention :)
More information about the Digitalmars-d
mailing list