www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Doug Lea's "concurrent" lib

reply Ben Hinkle <bhinkle4 juno.com> writes:
I've started a project on www.dsource.org for porting Doug Lea's
"concurrent" package. The download section has a zip file with the
code or you can get it from the svn repository. The doc (converted
from the orginal Javadoc and generated using doxygen) is at
http://home.comcast.net/~benhinkle/concurrent-doc/

Anyhow, I'm looking for either anyone interested in helping out or any
pointers to test suites for synchronization and threading. So far I've
done the basic Sync and Barrier classes and implemented a Java-style
wait/notify struct. There's just one file that knows about D
synchronization internals and has platform-specific code in it.

-Ben
May 02 2004
parent reply Mike Swieton <mike swieton.net> writes:
On Sun, 02 May 2004 15:55:58 -0400, Ben Hinkle wrote:

 I've started a project on www.dsource.org for porting Doug Lea's
 "concurrent" package. The download section has a zip file with the
 code or you can get it from the svn repository. The doc (converted
 from the orginal Javadoc and generated using doxygen) is at
 http://home.comcast.net/~benhinkle/concurrent-doc/
 
 Anyhow, I'm looking for either anyone interested in helping out or any
 pointers to test suites for synchronization and threading. So far I've
 done the basic Sync and Barrier classes and implemented a Java-style
 wait/notify struct. There's just one file that knows about D
 synchronization internals and has platform-specific code in it.
 
 -Ben

Cool ;) I was actually just minutes from doing just that myself, heh. I continued doing some more on some of the Executor classes (easy), and started the LinkedQueue class. I made Channel and friends templates, and changed their APIs accordingly. Some input on these changes would be appreciated. Matthew: what can we expect from the DTL as far as things like thread-safe collections are concerned? I'm not sure what I'm really asking here; I'm just wondering how/when the DTL will affect porting Doug's library. Currently, it segfaults, and I don't know why. I have to go do other stuff today, and I'll look at it again tomorrow. Right now I am primarily interested in feedback on the API changes and such that I've made. I have not updated much of the documentation that was copied in, and I am not sure where the InteruptedException fits in yet, as no D analog appears to exist yet. And no Windows or multi-processor testing has been done whatsoever. I don't have access to either. The latter will probably be a PITA down the line, though... Mike Swieton __ Our earth is degenerate in these latter days. Bribery and corruption are common. Children no longer obey their parents. Every man wants to write a book... The end of the world is evidently approaching. - On a stone slab carved in 2800 B.C. in Assyria
May 02 2004
next sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
"Mike Swieton" <mike swieton.net> wrote in message
news:pan.2004.05.03.01.29.03.75384 swieton.net...
 On Sun, 02 May 2004 15:55:58 -0400, Ben Hinkle wrote:

 I've started a project on www.dsource.org for porting Doug Lea's
 "concurrent" package. The download section has a zip file with the
 code or you can get it from the svn repository. The doc (converted
 from the orginal Javadoc and generated using doxygen) is at
 http://home.comcast.net/~benhinkle/concurrent-doc/

 Anyhow, I'm looking for either anyone interested in helping out or any
 pointers to test suites for synchronization and threading. So far I've
 done the basic Sync and Barrier classes and implemented a Java-style
 wait/notify struct. There's just one file that knows about D
 synchronization internals and has platform-specific code in it.

 -Ben

Cool ;) I was actually just minutes from doing just that myself, heh. I continued doing some more on some of the Executor classes (easy), and started the LinkedQueue class. I made Channel and friends templates, and changed their APIs accordingly. Some input on these changes would be appreciated. Matthew: what can we expect from the DTL as far as things like thread-safe collections are concerned? I'm not sure what I'm really asking here; I'm just wondering how/when the DTL will affect porting Doug's library.

Hmm. Initial thought was: nothing at all. Perhaps, it may be that if we (I) get the mixin, and they are selectable by template parameterisation, then we could make threadsafe collections just by having a null and a locking mixin. However, I think that collections are always the wrong place to be putting synchronisation logic, so maybe I'll go back to my original answer. Anything else could be characterised as intellectual playing-with-oneself.
 Currently, it segfaults, and I don't know why. I have to go do other stuff
 today, and I'll look at it again tomorrow. Right now I am primarily interested
 in feedback on the API changes and such that I've made.

 I have not updated much of the documentation that was copied in, and I am not
 sure where the InteruptedException fits in yet, as no D analog appears to
 exist yet. And no Windows or multi-processor testing has been done whatsoever.
 I don't have access to either. The latter will probably be a PITA down the
 line, though...

 Mike Swieton
 __
 Our earth is degenerate in these latter days. Bribery and corruption are
 common. Children no longer obey their parents. Every man wants to write a
 book... The end of the world is evidently approaching.
 - On a stone slab carved in 2800 B.C. in Assyria

May 02 2004
prev sibling next sibling parent reply Mike Swieton <mike swieton.net> writes:
I feel dumb. Here's the file that was supposed to be attached to the other ;)

Mike Swieton
__
If all the human race's collected information could be made available to
anyone, anywhere, at any time, for marginal cost, would it be moral to
restrict access to that informtion?
	- Eben Moglen
May 02 2004
next sibling parent Ben Hinkle <bhinkle4 juno.com> writes:
On Sun, 02 May 2004 21:41:09 -0400, Mike Swieton <mike swieton.net>
wrote:

I feel dumb. Here's the file that was supposed to be attached to the other ;)

lol - and I feel dumb for posting my reply asking where the code is before getting any new messages... oh well!
Mike Swieton
__
If all the human race's collected information could be made available to
anyone, anywhere, at any time, for marginal cost, would it be moral to
restrict access to that informtion?
	- Eben Moglen

May 02 2004
prev sibling parent reply "Ben Hinkle" <bhinkle4 juno.com> writes:
Hmm. now that I try the attachment it seems truncated. I can't open it. Can
you?

"Mike Swieton" <mike swieton.net> wrote in message
news:pan.2004.05.03.01.41.09.6279 swieton.net...
 I feel dumb. Here's the file that was supposed to be attached to the other

 Mike Swieton
 __
 If all the human race's collected information could be made available to
 anyone, anywhere, at any time, for marginal cost, would it be moral to
 restrict access to that informtion?
 - Eben Moglen

May 03 2004
parent reply Mike Swieton <mike swieton.net> writes:
On Mon, 03 May 2004 13:45:29 -0400, Ben Hinkle wrote:

 Hmm. now that I try the attachment it seems truncated. I can't open it. Can
 you?

I've posted an updated version (this one doesn't segfault) at http://www.csis.gvsu.edu/~swietonm/concurrent.tar.bz2. I am certain that this one is good as of right now. I'm still getting used to some of the interesting D-isms ;) My decision to change the Channel interface to be a templated collection is going to necessitate some changes, so I'll hold off on too much further development until people decide whether it's a good idea or not. Has anyone else started work on this? Would a mailing list be helpful? By the way, has anyone considered a name for the project other than "That concurrency library for java that Doug Lea wrote"? Are we just calling it Concurrent? libConcurrent? Doug Lea's Lovechild? 8-} Mike Swieton __ We owe most of what we know to about one hundred men. We owe most of what we have suffered to another hundred or so. - R. W. Dickson
May 03 2004
next sibling parent Ben Hinkle <bhinkle4 juno.com> writes:
 Has anyone else started work on this? Would a mailing list be helpful?

The forums at dsource are probably the best place to have discussions about it.
 By the way, has anyone considered a name for the project other than "That
 concurrency library for java that Doug Lea wrote"? Are we just calling it
 Concurrent? libConcurrent? Doug Lea's Lovechild? 8-}

The project at dsource is just "Concurrent" and the modules are "concurrent.all", "concurrent.mutex", etc. One nice thing about "Doug Lea's Lovechild" is that it abbreviates to DLL ;-)
 Mike Swieton
 __
 We owe most of what we know to about one hundred men. We owe most of what
 we have suffered to another hundred or so.
 - R. W. Dickson

May 03 2004
prev sibling parent "Walter" <newshound digitalmars.com> writes:
"Mike Swieton" <mike swieton.net> wrote in message
news:pan.2004.05.04.02.34.38.221062 swieton.net...
 By the way, has anyone considered a name for the project other than "That
 concurrency library for java that Doug Lea wrote"? Are we just calling it
 Concurrent? libConcurrent? Doug Lea's Lovechild? 8-}

Why not ask Doug?
May 25 2004
prev sibling parent Ben Hinkle <bhinkle4 juno.com> writes:
On Sun, 02 May 2004 21:29:03 -0400, Mike Swieton <mike swieton.net>
wrote:

On Sun, 02 May 2004 15:55:58 -0400, Ben Hinkle wrote:

 I've started a project on www.dsource.org for porting Doug Lea's
 "concurrent" package. The download section has a zip file with the
 code or you can get it from the svn repository. The doc (converted
 from the orginal Javadoc and generated using doxygen) is at
 http://home.comcast.net/~benhinkle/concurrent-doc/
 
 Anyhow, I'm looking for either anyone interested in helping out or any
 pointers to test suites for synchronization and threading. So far I've
 done the basic Sync and Barrier classes and implemented a Java-style
 wait/notify struct. There's just one file that knows about D
 synchronization internals and has platform-specific code in it.
 
 -Ben

Cool ;) I was actually just minutes from doing just that myself, heh. I continued doing some more on some of the Executor classes (easy), and started the LinkedQueue class. I made Channel and friends templates, and changed their APIs accordingly. Some input on these changes would be appreciated.

sounds good - where are the changes? I'm using the same public domain license as the original since 90% of the code is unchanged.
Matthew: what can we expect from the DTL as far as things like thread-safe
collections are concerned? I'm not sure what I'm really asking here; I'm just
wondering how/when the DTL will affect porting Doug's library.

Currently, it segfaults, and I don't know why. I have to go do other stuff
today, and I'll look at it again tomorrow. Right now I am primarily interested
in feedback on the API changes and such that I've made.

I have not updated much of the documentation that was copied in, and I am not
sure where the InteruptedException fits in yet, as no D analog appears to
exist yet. 

Instead of using InterruptedException I made wait() throw a new class called WaitException when it fails. I figured that name was more accurate than keeping the InterruptedException since you can't interrupt in D. Also I took out any code that was interrupting threads since the exception gets rethrown.
 And no Windows or multi-processor testing has been done whatsoever.
I don't have access to either. The latter will probably be a PITA down the
line, though...

I've been doing some Windows testing but my machine is single processor. I would like to also get the Fork/Join lightweight task classes going and those would definitely need multi-processor testing. Anyone have, ohh, say, a 30 CPU box lying around unused? :-)
Mike Swieton
__
Our earth is degenerate in these latter days. Bribery and corruption are
common. Children no longer obey their parents. Every man wants to write a
book... The end of the world is evidently approaching. 
	- On a stone slab carved in 2800 B.C. in Assyria

May 02 2004