[nzlug] Threading / Parallel Programming Languages

Matthew Diesch mdiesch at gmail.com
Fri Oct 20 11:07:29 NZDT 2006


On 20/10/06, Robin Sheat <robin at kallisti.net.nz> wrote:
>
> On Friday 20 October 2006 08:45, Matthew Diesch wrote:
> > Fortress sounds interesting but I've always liked Ada / Occam for the
> way
> > they handle parallel programming - i.e. natively as part of the language
> > not some half-arsed add-on
> Yeah, the way Java does threading really has the feeling of being bolted
> on in
> a not very nice way. It got a bit better with 1.5 (or was it 1.4) that got
> the concurrency package, which gives you a bunch of functions to make
> things
> a good bit nicer, but it's still not too pretty. But it does work well
> enough.
>
> The thing with Fortress (among other things) is that loops are implicitly
> parallel, e.g:
> for i $B"+(B 1 : 10 do
>     print(i " ")
> end
> could output:
> 5 4 6 3 7 2 9 10 1 8
>
> which is quite useful. After seeing this I wrote (in Perl) a 'map'-like
> function that works across 'n' processors, for some data-mining stuff.
> It's
> nice because it makes my dual-core much more useful, and if I set the
> threading to 4, then when one or two threads are waiting on IO, the
> remaining
> two are actually processing. Of course, Perl has closures which makes this
> sort of thing a lot nicer.


That's pretty cool. The only other thing I'd like is a nice easy way to
force certain processes/programs to run on specific a processor or
processors. I saw some stuff about setting process affinity a while back but
haven't had a chance to check it out further. Cool field  though - still
remember having my mind blown at uni when we were shown the butterfly sort -
better than linear speedup??? no way!!!  :-)



More information about the NZLUG mailing list