Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Some thoughts on threading

0 views
Skip to first unread message

Ron Blaschke

unread,
Dec 8, 2005, 11:16:48 AM12/8/05
to perl6-l...@perl.org
Hi everyone,

I am not a regular to this list but I'd like to induce some thoughts on
threading. I'm not too much into the subject myself, but I've got some
pointers, which I hope are of some use. Please ignore me if I am not
making any sense here.

Herb Sutter has an interesting article called "
The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software."
[1] He starts with "The biggest sea change in software development since
the OO revolution is knocking at the door, and its name is Concurrency."

Herb Sutter and James Larus continue with another interesting article about
"Software and the Concurrency Revolution." [2] They talk about "The problem
of shared state, and why locks aren't the answer" and "What we need in
programming languages."

Microsoft provides "An Overview of the Singularity Project." [3] In
Singularity, processes are very lightweight, and communicate with each
other through channels. Objects are owned by a single process only.

The Java folks have revamped "The Java Memory Model." [4] Can't say much
to that one, as I am not through with it yet.

Hans-J. Boehm argues that "Threads Cannot be Implemented as a Library." [5]

Ron

[1] http://www.gotw.ca/publications/concurrency-ddj.htm
[2]
http://acmqueue.com/modules.php?name=Content&pa=printer_friendly&pid=332&page=1
[3] ftp://ftp.research.microsoft.com/pub/tr/TR-2005-135.pdf
[4] http://www.cs.umd.edu/users/jmanson/java/journal.pdf
[5] http://www.hpl.hp.com/techreports/2004/HPL-2004-209.html

Sam Vilain

unread,
Dec 11, 2005, 6:18:47 PM12/11/05
to Ron Blaschke, perl6-l...@perl.org
On Thu, 2005-12-08 at 17:16 +0100, Ron Blaschke wrote:
> The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software."
> [1] He starts with "The biggest sea change in software development since
> the OO revolution is knocking at the door, and its name is Concurrency."

Perhaps have a read of:

http://svn.openfoundry.org/pugs/docs/AES/S17draft.pod

Two non-traditional methods of concurrency are discussed;

* atomic blocks - an atomic { } guard around a block that, assuming
the block performs no I/O, will guarantee atomic
success or failure of the block.

* co-routines - essentially co-operative multitasking between
'blocking' threads that actually switch tasks when
they block (or yield).

There is also some stuff there on other types of timesharing and
multiprocessing - Threads, Processes and Multiplexing (like Ruby).

Sam.

Ron Blaschke

unread,
Dec 14, 2005, 5:11:01 PM12/14/05
to perl6-l...@perl.org
On Mon, 12 Dec 2005 12:18:47 +1300, Sam Vilain wrote:
> On Thu, 2005-12-08 at 17:16 +0100, Ron Blaschke wrote:
>> The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software."
>> [1] He starts with "The biggest sea change in software development since
>> the OO revolution is knocking at the door, and its name is Concurrency."
>
> Perhaps have a read of:
>
> http://svn.openfoundry.org/pugs/docs/AES/S17draft.pod

Interesting read, thanks.


Just some braindump. How about async calls and future.

sub f is async returns future {
# your favorite expensive operations here
return $something;
}

my $x = f();
# some more expensive operations here
# this part executes concurrently
# with f() ...

# ... until the future is read for
# the first time; this will block until
# the value is available
say($x);

Ron

Ron

0 new messages