equal
deleted
inserted
replaced
274 NONE => () |
274 NONE => () |
275 | SOME work => (worker_exec work; worker_loop name)); |
275 | SOME work => (worker_exec work; worker_loop name)); |
276 |
276 |
277 fun worker_start name = (*requires SYNCHRONIZED*) |
277 fun worker_start name = (*requires SYNCHRONIZED*) |
278 let |
278 let |
279 val threads_stack_limit = |
|
280 Real.floor (Options.default_real "threads_stack_limit" * 1024.0 * 1024.0 * 1024.0); |
|
281 val stack_limit = if threads_stack_limit <= 0 then NONE else SOME threads_stack_limit; |
|
282 val worker = |
279 val worker = |
283 Isabelle_Thread.fork {name = "worker", stack_limit = stack_limit, interrupts = false} |
280 Isabelle_Thread.fork |
|
281 {name = "worker", stack_limit = Isabelle_Thread.stack_limit (), interrupts = false} |
284 (fn () => worker_loop name); |
282 (fn () => worker_loop name); |
285 in Unsynchronized.change workers (cons (worker, Unsynchronized.ref Working)) end |
283 in Unsynchronized.change workers (cons (worker, Unsynchronized.ref Working)) end |
286 handle Fail msg => Multithreading.tracing 0 (fn () => "SCHEDULER: " ^ msg); |
284 handle Fail msg => Multithreading.tracing 0 (fn () => "SCHEDULER: " ^ msg); |
287 |
285 |
288 |
286 |