Plasma GitLab Archive
Projects Blog Knowledge

Class type Netplex_types.parallelizer

class type parallelizer = object .. end

method ptype : parallelization_type
method init : unit -> unit
Initializes the main process for usage with this parallelizer. This method must not be called outside the internal Netplex implementation!
method start_thread : (par_thread -> unit) ->
Unix.file_descr list ->
Unix.file_descr list ->
string -> logger -> par_thread
start_thread f l_close l_share name logger: Starts a new thread or process and calls f thread in that context. Before this is done, file descriptors are closed, controlled by the parameters l_close and l_share. The descriptors in l_close are always closed. The descriptors in l_share are not closed. The implementation of the parallelizer is free to close a reasonable set of descriptors, and l_close is the minimum, and all - l_share is the maximum.

There is no way to check when the thread terminates.

It is allowed that the par_thread object passed to f is a different object as the returned par_thread object.

method create_mem_mutex : unit -> (unit -> unit) * (unit -> unit)
let lock, unlock = par#create_mem_locker(): Creates a mutex that is sufficient to protect process memory from uncoordinated access. The function lock obtains the lock, and unlock releases it.
method current_sys_id : [ `Process of int | `Thread of int ]
Returns the system-dependent thread identifier of the caller
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml