Hi all, I'd like to track a setting throughout my module (that will cause the [transparent] dispatch of either single-threaded or parallel versions of many different functions). Is there a more Julian way of doing the following? This seems inelegant:
_parallel = false # start off without parallelism - user calls parallelize() to set/unset. function parallelize(p::Bool=true) global _parallel = p end function foo(a::Int) # there will be many functions like this if _parallel _foo_parallel(a) else _foo_singlethread(a) end end