changeset 62501 | 98fa1f9a292f |
parent 62359 | 6709e51d5c11 |
--- a/src/Pure/RAW/multithreading.ML Wed Mar 02 19:43:31 2016 +0100 +++ b/src/Pure/RAW/multithreading.ML Thu Mar 03 11:12:02 2016 +0100 @@ -88,8 +88,13 @@ (* options *) +fun num_processors () = + (case Thread.numPhysicalProcessors () of + SOME n => n + | NONE => Thread.numProcessors ()); + fun max_threads_result m = - if m > 0 then m else Int.min (Int.max (Thread.numProcessors (), 1), 8); + if m > 0 then m else Int.min (Int.max (num_processors (), 1), 8); val max_threads = ref 1;