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
enter_blocking_section() and string modifications
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-04-02 (03:13)
From: Reed Wilson <cedilla@g...>
Subject: enter_blocking_section() and string modifications
Hi guys!

I'm currently writing a multi-threaded program, and part of the program 
is low-level string manipulation. I found that (with the code I'm using) 
making a tight C loop is quite a bit faster than using OCaml, so I'm 
using an external function for that.

My question is: can I use enter_blocking_section() for character 
replacement on an OCaml string? I know I can't use it for allocating 
anything on the heap due to the possibility of the GC doing funny things 
with it, but would straight replacement of existing string data be OK?

I did a test which runs OK, but "has not crashed" <> "will not crash"...