caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Bely <dmitry.bely@gmail.com>
To: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] GC interface question
Date: Fri, 1 Jul 2011 19:41:35 +0400	[thread overview]
Message-ID: <BANLkTim-tVnJya6gpLLW+MUELZMKzE7PKA@mail.gmail.com> (raw)
In-Reply-To: <4E0DE317.1010002@inria.fr>

On Fri, Jul 1, 2011 at 7:09 PM, Fabrice Le Fessant
<Fabrice.Le_fessant@inria.fr> wrote:
> On 07/01/2011 04:45 PM, Dmitry Bely wrote:
>>> Initialization to 0 for _varg is OK, of course.
>
> Is it the reply to your former question ?

Yes, thanks.

>> Yes, that's my modification. Original camlidl is not thread-safe.
>> Basically camlidl_acquire_runtime does caml_c_thread_register and
>> caml_leave_blocking_section. camlidl_release_runtime points to
>> caml_enter_blocking_section.
>
> If I understand your code, you release the master lock on the GC,

No.

> and then you call camlidl_alloc_small(). Shouldn't you hold the master lock
> while allocating ?

Of course. This function is called from C when no Ocaml code is
running and the Ocaml master lock is released. So I acquire it on
enter  (camlidl_acquire_runtime), call an Ocaml callback and release
on return (camlidl_release_runtime).

- Dmitry Bely

      reply	other threads:[~2011-07-01 15:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01  9:09 Dmitry Bely
2011-07-01 11:49 ` Damien Doligez
2011-07-01 12:06   ` Dmitry Bely
2011-07-01 11:56 ` Fabrice Le Fessant
2011-07-01 12:54   ` Dmitry Bely
2011-07-01 13:37     ` Fabrice Le Fessant
2011-07-01 14:44       ` Dmitry Bely
     [not found]       ` <801099288.1616121.1309531501115.JavaMail.root@zmbs4.inria.fr>
2011-07-01 15:09         ` Fabrice Le Fessant
2011-07-01 15:41           ` Dmitry Bely [this message]

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=BANLkTim-tVnJya6gpLLW+MUELZMKzE7PKA@mail.gmail.com \
    --to=dmitry.bely@gmail.com \
    --cc=Fabrice.Le_fessant@inria.fr \
    --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;
as well as URLs for NNTP newsgroup(s).