Version française
Home     About     Download     Resources     Contact us    
Browse thread
Ocaml implementation and low level details
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Ocaml implementation and low level details
On Thu, Jan 28, 2010 at 01:42:15PM +0100, Konstantin Tcholokachvili wrote:
> I am writing an operating system kernel and I am considering the idea of
> rewritting it in Ocaml or make a wrapper.
> As I don't  know how Ocaml is implemented in detail so I have the following
> question:
> If want to code in Ocaml without using the garbage collector, will I be able
> to use my own multithreading implementation or will I be limited by Ocaml's
> global lock?

You're probably better off not using the current runtime, but instead
implementing enough of the runtime based on the functions that the
code generator needs.  But reading the rest of the thread it sounds
like you really need to look deeply at the current implementation
first before you are in a position to make any decision (luckily the
runtime of OCaml is not hard to understand, and is mostly written in
C).  Asking if one can code in OCaml "without using the garbage
collector" doesn't really make any sense as a question, since at least
the minor heap is a fundamental concept in the language.  And the
"global lock" just prevents reentrancy in the current implementation
of the GC -- you can easily use one minor heap per thread, although
that is likely to just push the problem elsewhere.

Rich.

-- 
Richard Jones
Red Hat