This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

runnable closure limitation


At one time, Kawa's implementation of runnable closures included
an explicit reference to its environment. In the current
implementation, it relies on the affinity between threads and
environments to associate the runnable with the environment. 
This is fine for one-shot runnables, but it's a problem if the
runnable is executed repeatedly by, say, a ThreadPoolExecutor,
where the environment can change from one execution to the next
(but then it's hardly a closure). I don't want to call this a bug
since taking the environment ref out of RunnableClosure was 
clearly intentional (but why?), and I may have missed something.

If this is the intended behavior of runnable, the documentation 
should make this limitation clear. Unfortunately it's not a 
fail-fast scenario, as things may appear to work properly for 
a long time if the executor uses the same task thread most of the 
time (which is often the case). 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]