Module Migrate


module Migrate: sig .. end
Migrating fair threads library

exception Migration_forbidden
Trying to migrate from a local fair thread
val safe_read : Unix.file_descr -> String.t -> int -> unit
IO primitives to use with migrating fthreads
val safe_write : Unix.file_descr -> String.t -> int -> unit
val read_line : unit -> String.t
val create : (int -> unit) -> int -> unit
Creates a migrating fair thread Migrate.create (fun home -> ...) comp launch the thread (fun home -> ...) on the computer comp (home = comp)
val computer : int Pervasives.ref
Reference to the current computer
val nbr_comp : int Pervasives.ref
Reference to the number of computer connected
val last_comp : int Pervasives.ref
Reference to !nbr_comp-1
val migrate : int -> unit
a call to Migrate.migrate x makes the current fair thread continue his execution on the computer x. (does nothing if x = !computer)
val exit : unit -> unit
This function HAS to be the last function call of the program. If the last line of your program is not Migrate.exit(), no thread will be launched.