Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Masateru Kawaguchi <masateru.k@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] C function calls OCaml function in multithreads
Date: Mon, 9 Mar 2015 10:31:17 +0900	[thread overview]
Message-ID: <CALk-pjMzPrv09G72hnEaamTsYDuJ=JF_Lwfv_tvgdmNf3=EC8g@mail.gmail.com> (raw)
In-Reply-To: <CALk-pjNFU11K07Z=5OE_jMJfWEy4SMWLxp8+eJ_=egtmFxkW6A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

Hello,

I sent a question to caml-list a few days ago, but there is no reply yet.
So let me explain my question in detail.

I have a C program and I'll try to rewrite some libraries of them in OCaml.
The C program runs in multithreads, so the OCaml library will be called by
multithread.
In order to avoid two threads running the OCaml part at one time, I'll try
insert
a code to acquire mutex lock in the C function before calling the OCaml
function.
But I'm not sure that is enough to run the program safely.

Does anyone know about it ?
Please give me some advise about multithreading or how to incorporate OCaml
into C program.

Best regards,
Masateru Kawaguchi

2015-03-05 11:31 GMT+09:00 Masateru Kawaguchi <masateru.k@gmail.com>:

> Hello,
>
> I'm implementing a C function that calls an OCaml function.
>
> If the C function is called by multithreads, the OCaml function works fine
> ?
> Is that all right when the C function uses mutual exclusion locks ?
>
> Best regards,
> Masateru Kawaguchi
>
>

[-- Attachment #2: Type: text/html, Size: 1702 bytes --]

  reply	other threads:[~2015-03-09  1:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05  2:31 Masateru Kawaguchi
2015-03-09  1:31 ` Masateru Kawaguchi [this message]
2015-03-09  7:36   ` David Allsopp
2015-03-09  9:21     ` Masateru Kawaguchi
2015-03-09  9:43       ` David Allsopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALk-pjMzPrv09G72hnEaamTsYDuJ=JF_Lwfv_tvgdmNf3=EC8g@mail.gmail.com' \
    --to=masateru.k@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox