Re:No More Callbacks: 10,000 Actors, 10,000 Threads, 10,000 ...
by eeperson on Wednesday October 16, 2013 @04:12PM
(#6561871)
How does the Quasar know when it should defer execution of something that might block? Does the user declare this in some fashion? In the article, it looks like this is done with try-with-resource blocks.
[ Parent
| on HN ]
Re:No More Callbacks: 10,000 Actors, 10,000 Threads, 10,000 ...
by pron on Wednesday October 16, 2013 @04:55PM
(#6562110)
The try-with-resource block is used to delineate an atomic transaction, and is part of the SpaceBase API. An example in the code for a blocking call is the call to receive.
Quasar identifies blocking methods if they declare that the throw a SuspendExecution exception, marked with a @Suspendable annotation, or listed in an external file. Pulsar, Quasar's Clojure API, marks suspendable functions differently, but that's an implementation detail.