Hi guys,
Sleep 2.1-b21 has been released. This release fixes some bugs and
adds a few features. I recommend reading the changelog before
deploying this release.
The semantics of fork and how variables are shared has changed. Data
is still shared but containers are not. For example, if you
fork(&function, \$counter) then the new thread will receive a copy of
$counter. Any updates to $counter within the thread will not affect
$counter outside of the thread. To update a shared reference, pass an
array or a hash to fork and use an element of the data structure as
your shared value.
I cleaned up several corner cases with how Sleep handles
continuations. There was a problem with Sleep not calling the callcc
function of parent calls originating outside of Sleep's interpreter in
Block.java. I fixed this but at a cost. Continuations that call into
other continuations will continue to keep frames active in Java's call
stack. Having continuations call into each other back and forth
without returning could potentially lead to a Java stack overflow
(i.e. a callcc implementation of producer/consumer). If this is an
issue let me know and I'll take a serious look at how to remedy it.
Expect the next release or two to be pretty small. My main goal is to
work on the documentation. I just wanted to clean up several things
and add a few features to makeup for functionality gaps.
As usual, the latest beta can be found at:
http://sleep.hick.org/download.html
The changelog:
http://sleep.hick.org/changelog.html
Enjoy the beta.
-- Raphael