RE: Synchronized / Thread syntax in Perl 6

2006-06-02 Thread John Drago
eue( Code @jobs_in ) returns List of Any { > > my Any @results is parallel; > > my Thread @workers = (); > > > > for @jobs_in { > > @workers.push( async { &_() } ); > > } > > for @workers { > > @results.push( $_.jo

RE: Synchronized / Thread syntax in Perl 6

2006-06-02 Thread John Drago
= class QueueRunner { our sub process_job_queue( Code @jobs_in ) returns List of Any { my Any @results is parallel; my Thread @workers = (); for @jobs_in { @workers.push( async { &_() } ); } for @workers { @results.push( $_.join() ); } return @results; }# end process_job_queue() }# end QueueRunner # Elsewhere... my @answer = QueueRunner.process_job_queue( @jobs ); # I made absolutely no progress here. It seems to me that it's no more obvious what's going on here than in the Perl5 version. Any comments? Regards, John Drago

RE: Synchronized / Thread syntax in Perl 6

2006-05-31 Thread John Drago
Thanks to all who have read or replied - I'm reading the Concurrency POD right now - more questions when I'm done. ____ John Drago | VP Software Engineering [EMAIL PROTECTED] www.precissystems.com > -Original Message- > From: Benjam

RE: Synchronized / Thread syntax in Perl 6

2006-05-31 Thread John Drago
James Mastros wrote: > I don't like the name synchronized -- it implies that multiple things are > happening at the same time, as in synchronized swiming, which is exactly the > opposite of what should be implied. "Serialized" would be a nice name, > except it implies serializing to a serial form

Synchronized / Thread syntax in Perl 6

2006-05-31 Thread John Drago
ethod Bar is synchronized { ... } class Baz { has $.Bux is synchronized; } ...or is there some new, less Java-esque way to express "only one thread may access this thing at a time"? ____ John Drago | VP Software Engineering [