55.5.0+dev0-2025-04-28/&Domain!tA;!a@@A@A@O@B@@@7../../stdlib/domain.mli]]@@@@&Domain@@A@%spawn@@$unit#@@@!a@B@@@&Domain$!t@@@@@@$aqq%aq@@#A@@$join@&Domain%!t!a@B@@@@@@@>hHH?hH]@@=B@@"idB;@@J@#int&@@@@@@@Nm**Om*?@@A@MC@A@&get_id@&Domain'!t!a@C@@@@&Domain("id@@@@@@ppppqpp@@oD@@$self@l)@@@&Domain*"id@@@@@@ss@@E@@2before_first_spawn@@+@@@,@@@@@-@@@@@@v  v  M@@F@@'at_exit@@.@@@/@@@@@0@@@@@@    8@@G@@)cpu_relax@1@@@2@@@@@@QQ4@@H@@.is_main_domain@3@@@$bool4@@@@@@UU@@I@@8recommended_domain_count@5@@@6@@@@@@XXE@@J@@*self_index@7@@@8@@@@@@^^ @@K@@ӱ#DLS"C@#keyD;!a@@A,A@G@B@@@+m,m@@@@*L@A@'new_key1split_from_parent&optionL@!a@E@@@@@@@@<9@@@@@&Domain:#DLS#key@@@@@@@@[p\pG@@ZM@@#get @&Domain;#DLS#key!a@E@@@@@@@wx@@vN@@#set!@&Domain<#DLS#key!a@E@@@@@ =@@@@@@@@@@O@@@@j@P@@@@3(Domains.@ 6 See 'Parallel programming' chapter in the manual.@@@@#5.0@@@@@@(unstable CThe Domain interface may change in incompatible ways in the future.@A7../../stdlib/domain.mli#(Domain.t31A domain of type $'a t R runs independently, eventually producing a result of type 'a, or an exception@@@@@@@@@@@@O@@A@@@@,Domain.spawn3'spawn f H creates a new domain that runs in parallel with the current domain.@@@@@@@@'Failure Gif the program has insufficient resources to create another domain.@@@@@@ @@@@+Domain.join3&join d5 blocks until domain !d8 runs to completion. If !d 2 results in a value, then that is returned by &join d%. If !d = raises an uncaught exception, then that is re-raised by &join d!.@@@@@@@@@@@@@1@@@@ՠ#)Domain.id3 'Domains have unique integer identifiers@@@@@@@@@@@@@@@נ@@@-Domain.get_id3(get_id d & returns the identifier of the domain !d@@@@@@@@@@@@@U@@@@Ǡ+Domain.self3'self () 2 is the identifier of the currently running domain@@@@@@@@@@@@@g@@@@9Domain.before_first_spawn34before_first_spawn f+ registers !f g to be called before the first domain is spawned by the program. The functions registered with 2before_first_spawn L are called on the main (initial) domain. The functions registered with 2before_first_spawn O are called in 'first in, first out' order: the oldest function added with 2before_first_spawn1 is called first.@@@@@@@@0Invalid_argument ,if the program has already spawned a domain.@@@@@@@@@@ՠ.Domain.at_exit3)at_exit f+ registers !f ; to be called when the current domain exits. Note that 'at_exit callbacks are domain-local and only apply to the calling domain. The registered functions are called in 'last in, first out' order: the function most recently added with 'at_exit= is called first. An example:@% let temp_file_key = Domain.DLS.new_key (fun _ -> let tmp = snd (Filename.open_temp_file "" "") in Domain.at_exit (fun () -> close_out_noerr tmp); tmp) @ { The snippet above creates a key that when retrieved for the first time will open a temporary file and register an 'at_exit o callback to close it, thus guaranteeing the descriptor is not leaked in case the current domain exits.@@@@@@@@@@@@@@@@@0Domain.cpu_relax3 oIf busy-waiting, calling cpu_relax () between iterations will improve performance on some CPU architectures@@@@@@@@@@@@@@@@@蠕5Domain.is_main_domain31is_main_domain () 0 returns true if called from the initial domain.@@@@@@@@@@@@@@@@@䠕?Domain.recommended_domain_count3 yThe recommended maximum number of domains which should be running simultaneously (including domains already running).@ $ The value returned is at least !1!.@@@@@@@@@@@@@@@@@蠕1Domain.self_index3 nThe index of the current domain. It is an integer unique among currently-running domains, in the interval &0; N-1 I where N is the peak number of domains running simultaneously so far.@ N The index of a terminated domain may be reused for a new domain. Use 7(Domain.self () :> int) T instead for an identifier unique among all domains ever created by the program.@@@@#5.3@@@@@@@@'@@@@/*Domain.DLS@AZ4Domain-local Storage@#.Domain.DLS.key31Type of a DLS key@@@@@@@@@@@@G@@A@@@@2Domain.DLS.new_key3)new_key f ( returns a new key bound to initialiser !f . for accessing domain-local variables.@, If 1split_from_parent u is not provided, the value for a new domain will be computed on-demand by the new domain: the first #get call will call the initializer !f6 and store that value.@) (Warning.@! !f 8 may be called several times if another call to #get  occurs during initialization on the same domain. Only the 'first' value computed will be used, the other now-useless values will be discarded. Your initialization function should support this situation, or contain logic to detect this case and fail.@, If 1split_from_parent e is provided, spawning a domain will derive the child value (for this key) from the parent value. This computation happens in the parent domain and it always happens, regardless of whether the child domain will use it. If the splitting function is expensive or requires child-side computation, consider using -'a Lazy.t key!:@) 8 let init () = ... let split_from_parent parent_value = ... parent-side computation ...; lazy ( ... child-side computation ... ) let key = Domain.DLS.new_key ~split_from_parent init let get () = Lazy.force (Domain.DLS.get key) @ r In this case a part of the computation happens on the child domain; in particular, it can access ,parent_value u concurrently with the parent domain, which may require explicit synchronization to avoid data races.@@@@@@@@@@@@P@PO@A@@@@1.Domain.DLS.get3%get k) returns !v, if a value !v: is associated to the key !k : on the calling domain's domain-local state. Sets !k ?'s value with its initialiser and returns it otherwise.@@@@@@@@@@@@M@N@@@@?.Domain.DLS.set3'set k v N updates the calling domain's domain-local state to associate the key !k, with value !v :. It overwrites any previous values associated to !k !, which cannot be restored later.@@@@@@@@@@@@U@V@O@@@@C@@A@@@@@@@@1@@A@@@@@