Up

module Execution_context

: sig

The context in which an Async job runs.

#
type t = {
# monitor
: Raw_monitor.t;
# priority
: Priority.t;
# local_storage
: Core.Std.Univ_map.t;
# backtrace_history
: Core.Std.Backtrace.t list;(*kill_index is a "cached" copy of monitor's kill_index. This allows the scheduler, when deciding whether to run a job, to do a fast check in the common case that the execution context's kill_index is up to date, i.e. equal to the scheduler's global_kill_index. If it's not, then the scheduler will update the kill_index for itself and monitor (and monitor's ancestors).*)
# mutable kill_index
: Kill_index.t;
}
#
val kill_index : t -> Kill_index.t
#
val set_kill_index : t -> Kill_index.t -> unit
#
val backtrace_history : t -> Core.Std.Backtrace.t list
#
val local_storage : t -> Core.Std.Univ_map.t
#
val priority : t -> Priority.t
#
val monitor : t -> Raw_monitor.t
#
module Fields : sig
#
val names : string list
#
val kill_index : (t, Kill_index.t) Fieldslib.Field.t
#
val backtrace_history : (t, Core.Std.Backtrace.t list) Fieldslib.Field.t
#
val local_storage : (t, Core.Std.Univ_map.t) Fieldslib.Field.t
#
val priority : (t, Priority.t) Fieldslib.Field.t
#
val monitor : (t, Raw_monitor.t) Fieldslib.Field.t
#
val fold : init:'acc__ -> monitor:('acc__ -> (t, Raw_monitor.t) Fieldslib.Field.t -> 'acc__) -> priority:('acc__ -> (t, Priority.t) Fieldslib.Field.t -> 'acc__) -> local_storage:('acc__ -> (t, Core.Std.Univ_map.t) Fieldslib.Field.t -> 'acc__) -> backtrace_history:('acc__ -> (t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> 'acc__) -> kill_index:('acc__ -> (t, Kill_index.t) Fieldslib.Field.t -> 'acc__) -> 'acc__
#
val make_creator : monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> 'compile_acc__ -> ('input__ -> Raw_monitor.t) * 'compile_acc__) -> priority:((t, Priority.t) Fieldslib.Field.t -> 'compile_acc__ -> ('input__ -> Priority.t) * 'compile_acc__) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> 'compile_acc__ -> ('input__ -> Core.Std.Univ_map.t) * 'compile_acc__) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> 'compile_acc__ -> ('input__ -> Core.Std.Backtrace.t list) * 'compile_acc__) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> 'compile_acc__ -> ('input__ -> Kill_index.t) * 'compile_acc__) -> 'compile_acc__ -> ('input__ -> t) * 'compile_acc__
#
val create : monitor:Raw_monitor.t -> priority:Priority.t -> local_storage:Core.Std.Univ_map.t -> backtrace_history:Core.Std.Backtrace.t list -> kill_index:Kill_index.t -> t
#
val map : monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> Raw_monitor.t) -> priority:((t, Priority.t) Fieldslib.Field.t -> Priority.t) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> Core.Std.Univ_map.t) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> Core.Std.Backtrace.t list) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> Kill_index.t) -> t
#
val iter : monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> unit) -> priority:((t, Priority.t) Fieldslib.Field.t -> unit) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> unit) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> unit) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> unit) -> unit
#
val for_all : monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> bool) -> priority:((t, Priority.t) Fieldslib.Field.t -> bool) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> bool) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> bool) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> bool) -> bool
#
val exists : monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> bool) -> priority:((t, Priority.t) Fieldslib.Field.t -> bool) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> bool) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> bool) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> bool) -> bool
#
val to_list : monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> 'elem__) -> priority:((t, Priority.t) Fieldslib.Field.t -> 'elem__) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> 'elem__) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> 'elem__) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> 'elem__) -> 'elem__ list
#
val map_poly : ([<
| `Read
| `Set_and_create
], t, 'x0) Fieldslib.Field.user -> 'x0 list
#
module Direct : sig
#
val iter : t -> monitor:((t, Raw_monitor.t) Fieldslib.Field.t -> t -> Raw_monitor.t -> unit) -> priority:((t, Priority.t) Fieldslib.Field.t -> t -> Priority.t -> unit) -> local_storage:((t, Core.Std.Univ_map.t) Fieldslib.Field.t -> t -> Core.Std.Univ_map.t -> unit) -> backtrace_history:((t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> t -> Core.Std.Backtrace.t list -> unit) -> kill_index:((t, Kill_index.t) Fieldslib.Field.t -> t -> Kill_index.t -> unit) -> unit
#
val fold : t -> init:'acc__ -> monitor:('acc__ -> (t, Raw_monitor.t) Fieldslib.Field.t -> t -> Raw_monitor.t -> 'acc__) -> priority:('acc__ -> (t, Priority.t) Fieldslib.Field.t -> t -> Priority.t -> 'acc__) -> local_storage:('acc__ -> (t, Core.Std.Univ_map.t) Fieldslib.Field.t -> t -> Core.Std.Univ_map.t -> 'acc__) -> backtrace_history:('acc__ -> (t, Core.Std.Backtrace.t list) Fieldslib.Field.t -> t -> Core.Std.Backtrace.t list -> 'acc__) -> kill_index:('acc__ -> (t, Kill_index.t) Fieldslib.Field.t -> t -> Kill_index.t -> 'acc__) -> 'acc__
end
end
include Core.Std.Invariant.S with type t := t
#
val main : t
#
val create_like : ?monitor:Raw_monitor.t -> ?priority:Priority.t -> ?local_storage:Core.Std.Univ_map.t -> t -> t
#
val find_local : t -> 'a Core.Std.Univ_map.Key.t -> 'a option
#
val with_local : t -> 'a Core.Std.Univ_map.Key.t -> 'a option -> t
#
val record_backtrace : t -> t
#
val is_alive : t -> global_kill_index:Kill_index.t -> bool
#
val sexp_of_t : t -> Sexplib.Sexp.t
end