Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: ygrek <ygrekheretix@gmail.com>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Wrapping C code using pthread.
Date: Sun, 27 Dec 2009 13:19:36 +0100	[thread overview]
Message-ID: <4B3750D8.8000209@citycable.ch> (raw)
In-Reply-To: <20091227114253.a0a9ff49.ygrekheretix@gmail.com>

ygrek a écrit :
> On Fri, 25 Dec 2009 21:57:21 +0100
> Guillaume Yziquel <guillaume.yziquel@citycable.ch> wrote:
> 
>> Hello.
>>
>> I'm currently trying to wrap up together a C interface for the MonetDB5 
>> database system. I'm getting quite a lot of segfaults (a lot of which 
>> come from MonetDB itself), and I'm therefore wondering the following 
>> about pthreads and OCaml:
>>
>> The server is started via a pthread:
>>
>> pthread_create(&sqlthread, NULL, start_sql_server, (void *) server);
>>
>> and I would like to know what kind of things I should look at with 
>> C-side pthreads in order to avoid segfaults...
> 
> How does the OCaml code gets executed? Via callbacks from this thread?
> If so, have a look at http://caml.inria.fr/mantis/view.php?id=4702

Thanks for the pointer.

No this is not the case. In fact, it's a library that starts an embedded 
database server in its own pthread. Completely distinct from OCaml.

In fact, my trouble is that when things are compiled to native code, it 
works fine. However, things get screwed up when compiled to bytecode, 
resulting in a segfault.

Are pthreads compatible with OCaml bytecode?

All the best,

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/


  reply	other threads:[~2009-12-27 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-25 20:57 Guillaume Yziquel
2009-12-27  9:42 ` [Caml-list] " ygrek
2009-12-27 12:19   ` Guillaume Yziquel [this message]
2009-12-27 21:27     ` ygrek
2009-12-27 21:33       ` Guillaume Yziquel
2009-12-29  3:39         ` Jake Donham
2009-12-30 23:50           ` Guillaume Yziquel

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=4B3750D8.8000209@citycable.ch \
    --to=guillaume.yziquel@citycable.ch \
    --cc=caml-list@inria.fr \
    --cc=ygrekheretix@gmail.com \
    /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