On 23 Jan 2011, at 23:04, Juan Jose Garcia-Ripoll wrote:
On Fri, Jan 21, 2011 at 9:07 PM, Pascal Costanza pc@p-cos.net wrote: The development platform is LispWorks 6.0, which comes with an excellent library for SMP. (I would say it's the best of any dynamic language I am currently aware of, not just those of Lisp dialects.)
I would be interested on learning what aspects of LispWorks make it interesting for SMP, specially if some of those ideas can be adapted to ECL. Does their library provide a better granularity when controlling threads than C? Is it the inter-process communication?
What is important in an SMP library is the kinds of synchronization primitives you get. LispWorks provides both very high-level synchronization via mailboxes, which are extremely convenient to use and cover 80-90% of all cases, in my experience. On top of that, LispWorks provides the usual mutual exclusion via locks, but also more fine-grained synchronization primitives, like read/write (shared) locks, compare-and-swap / atomic operations, barriers, and ordering of memory accesses. The API is very well designed and covers a lot of practically occurring cases.
LispWorks doesn't focus on providing a single parallel programming paradigm, but rather gives you the building blocks to create your own approach. We have already experimented with building STM, work stealing, data parallelism and automatic parallelization internally (to different extents), and it all works extremely well on top of LispWorks.
If you are looking for inspiration, I think the LispWorks documentation is available for free on their website. There is also a personal edition of LispWorks 6.0 that you can play with.
I hope this helps, Pascal