Version franÁaise
Home ††† About ††† Download ††† Resources ††† Contact us †††
Browse thread
problem creating .cma library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_B√ľnzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] problem creating .cma library
> So if I want to call R code that multithreads with OCaml, I should write
> something like
>>  enter_blocking_section();
>>  PROTECT(e = R_tryEval(Sexp_val(sexp_list), R_GlobalEnv, &error));
>>  leave_blocking_section();
> Am I correct?

Yes, but the functions have now a caml_ prefix.

Make sure that there is no interaction whatsoever with ocaml's runtime
system (e.g. ocaml value allocation) between the two calls.

Note also that in case you need to use some caml value after the leave
call you have to declare it with a CAMLparam macro as it may move
during the blocking section even if the stub itself doesn't allocate.