Version française
Home     About     Download     Resources     Contact us    
Browse thread
Can GC be BLOCKed?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <H.Tews@c...>
Subject: Re: [Caml-list] Can GC be BLOCKed?
"Neal Wang" <neal.wang@gmail.com> writes:

   The problem is not caused by real-time requirement.

I would also suggest to solve you problem by postponing the
write-backs using some queue either in ocaml or on the C side.

However:

   IMHO, providing a way to disable GC will help a lot in variant
   situations.  The only side effect of misuse such a feature is out of
   memory exception which does happen even GC is always enabled.

I find it also an interesting idea to be able to block the GC for
certain periods. However, it seems that exceptions are heap
allocated, so you would have to allocate the Out_of_memory
exception statically (not sure if that's possible).

Further, if GC is blocked and the heap is full you can do almost
nothing until the collection is completed. All functions that
catch and reraise exceptions like

   try
     ...
   with
     | x -> release_the_lock(); raise x

would probably not work as expected with an Out_of_memory
exception.

Bye,

Hendrik