Concurrent_in_threadAn implementation of concurrency that spawns tasks as systhreads onto domains.
The spawn options are interpreted as follows:
affinity: Selects the domain to spawn onto, modulo the maximum number of domains.name: Sets the name of the spawned thread using pthread_setname_np. Names are limited to 15 characters on Linux - any longer names will be truncated.val scheduler : Base.unit Concurrent.Scheduler.t @@ portablescheduler is a concurrent scheduler which spawns tasks as systhreads onto domains, using await as the implementation of awaiting
val create :
Await.Await.t @ local portable ->
Base.unit Concurrent.t @ local portable @@ portablecreate await is an implementation of concurrency which spawns tasks as systhreads onto domains, using await as the implementation of awaiting
val with_blocking :
Await.Terminator.t @ local ->
(f:(Base.unit Concurrent.t @ local portable -> 'r) @ local once ->
'r) @ local @@ portablewith_blocking terminator ~f calls f with an implementation of concurrency that spawns preemptively scheduled threads onto arbitrary (managed) domains.
All scopes created using this implementation of concurrency block the calling thread using Await_blocking. If you rely on this thread to run the Async scheduler, instead call create with an implementation of awaiting from Await_in_async.
val spawn_into :
('a, _) Concurrent.Spawn.t @ local ->
('a, Base.unit) Concurrent.Spawn.t @ local @@ portablespawn_into spawn is a Concurrent.Spawn.t which spawns task into the scope associated with the given spawn as threads in arbitrary (managed) domains.
val in_scope :
Await.Await.t @ local ->
('a Await.Scope.t @ local ->
('a, Base.unit) Concurrent.Spawn.t @ local portable) @ local @@ portablein_scope await scope is a Concurrent.Spawn.t which spawns tasks into the given scope as threads in arbitrary (managed) domains, and uses await as its implementation of awaiting
module Expert = Multicore