1signature smlParallel = 2sig 3 4 (* internal *) 5 val use_thread_flag : bool ref (* for debugging *) 6 val parmap_exact : int -> ('a -> 'b) -> 'a list -> 'b list 7 val parmap_batch : int -> ('a -> 'b) -> 'a list -> 'b list 8 val parmap_gen : int -> (('a -> 'b) -> 'a list -> 'b list) * (unit -> unit) 9 val parmap_queue : int -> ('a -> 'b) -> 'a list -> 'b list 10 val parapp_queue : int -> ('a -> 'b) -> 'a list -> unit 11 12 (* external *) 13 val default_parallel_dir : string 14 (* 'a: type of parameter, 'b: type of arguments, 'c: returned type *) 15 type ('a,'b,'c) extspec = 16 { 17 self: string, 18 parallel_dir: string, 19 reflect_globals : unit -> string, 20 function : 'a -> 'b -> 'c, 21 write_param : string -> 'a -> unit, 22 read_param : string -> 'a, 23 write_arg : string -> 'b -> unit, 24 read_arg : string -> 'b, 25 write_result : string ->'c -> unit, 26 read_result : string -> 'c 27 } 28 val worker_start : int -> ('a,'b,'c) extspec -> unit 29 val parmap_queue_extern : 30 int -> ('a,'b,'c) extspec -> 'a -> 'b list -> 'c list 31 32 (* example *) 33 val idspec : (unit,int,int) extspec 34 35end 36