swh:1:snp:2d869aa00591d2ac8ec8e7abacdda563d413189d
Raw File
Tip revision: f140dbc8b05aa3d341c70436a1920a06df9a0ed4 authored by Roberto Di Cosmo on 02 May 2021, 17:11:46 UTC
Signal exceptions in the worker to the master process in the simplemapper skeleton.
Tip revision: f140dbc
testexceptions.ml
(**************************************************************************)
(* Sample use of Parmap, a simple library to perform Map computations on  *)
(* a multi-core                                                           *)
(*                                                                        *)
(*  Author(s):  Roberto Di Cosmo                                          *)
(*                                                                        *)
(*  This program is free software: you can redistribute it and/or modify  *)
(*  it under the terms of the GNU General Public License as               *)
(*  published by the Free Software Foundation, either version 2 of the    *)
(*  License, or (at your option) any later version.                       *)
(**************************************************************************)

Printf.eprintf "Testing capture of exception: this code should exit normally, without segfault.\n%!";;

Parmap.debugging true;;

let _ =
  try
    Parmap.parmap
      (function x ->
	failwith "should not crash")
      (Parmap.L [1;2;3;4;5])
  with _ -> (Printf.printf "Exceptions are properly catched, no SIGSEV"; exit 0)

  

back to top