You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Thunk.java : if the run method terminates concurrently with a cancellation, interruption flag may be reset before the runner thread is interrupted by the canceller thread, resulting with the interruption flag set when the runner thread starts the next task.
Not a problem with executors exposed by missionary because j.u.c.ThreadPoolExecutor resets the flag between successive tasks anyways, but could be problematic if via is used with another executor implementation.
The text was updated successfully, but these errors were encountered:
(let [begin (System/currentTimeMillis)
;; create a flow of values generated by asynchronous tasks
inputs (repeat100000 (m/via m/cpu "hi")) ;; a task has no identity, it can be reused
values (m/ap
(let [flow (m/seed inputs) ;; create a flow of tasks to execute
task (m/?>##Inf flow)] ;; from here, fork on every task in **parallel**
(m/? task))) ;; get a forked task value when available;; drain the flow of values and count them
n (m/?;; tasks are executed, and flow is consume here!
(m/reduce (fn [acc v]
(assert (="hi" v))
(inc acc))
0 values))]
(println"Read" n "msgs in" (- (System/currentTimeMillis) begin) "ms"))
In
Thunk.java
: if the run method terminates concurrently with a cancellation, interruption flag may be reset before the runner thread is interrupted by the canceller thread, resulting with the interruption flag set when the runner thread starts the next task.Not a problem with executors exposed by missionary because
j.u.c.ThreadPoolExecutor
resets the flag between successive tasks anyways, but could be problematic ifvia
is used with another executor implementation.The text was updated successfully, but these errors were encountered: