Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Wrapping C code using pthread.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Re: [Caml-list] Wrapping C code using pthread.
ygrek a écrit :
> On Fri, 25 Dec 2009 21:57:21 +0100
> Guillaume Yziquel <> 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

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