From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id DCD36BBCA for ; Wed, 2 Apr 2008 05:13:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnIBABOX8kfRVZKwc2dsb2JhbACRSwEMAwQFCRSUFoYl X-IronPort-AV: E=Sophos;i="4.25,590,1199660400"; d="scan'208";a="24482144" Received: from wa-out-1112.google.com ([209.85.146.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 02 Apr 2008 05:13:13 +0200 Received: by wa-out-1112.google.com with SMTP id k17so2862084waf.3 for ; Tue, 01 Apr 2008 20:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; bh=d18Pb0qFyRACq3Mk2+oMI1gEN4ImKG0gJvv6eCwFeuM=; b=tUtIr1jnOF/Yxq+UA919UZiBnT/uD2s7dAtWjo7suX2i+dqS+0h2nXUwDeWFo+X9JBGTlfpkGvRnn3irSU5zDmRGipcZ3iSChlR2UZesZ0Usx1Axy0AqtDV5vtzwnx7sIK+hVV9VqddFTeiRv5F5G02xSY5V3ExwVAMQpVvxMKc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=ehvG6qxYm2fKo7hl5UkKUv+UaKDR7IoHHZRjsk4eF/HGARhkmjmfTVXbrtzTgasQ52HZfJiDvIK5w51ybEVopr81C4JvkLiGuD82muC1NFW5oT29I6ovuqOqUsn1b0dL+6uisxu2XTIIzWWOUuf8RjoghIBUlmDHot6wSxk4IRk= Received: by 10.114.181.6 with SMTP id d6mr13879242waf.50.1207105991826; Tue, 01 Apr 2008 20:13:11 -0700 (PDT) Received: from ?192.168.1.100? ( [75.11.165.6]) by mx.google.com with ESMTPS id l22sm2238165waf.10.2008.04.01.20.13.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Apr 2008 20:13:11 -0700 (PDT) Message-ID: <47F2F9BC.4020502@gmail.com> Date: Tue, 01 Apr 2008 20:13:00 -0700 From: Reed Wilson User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: enter_blocking_section() and string modifications Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; low-level:01 ocaml:01 ocaml:01 allocating:01 heap:01 data:02 string:02 string:02 external:03 character:04 crashed:04 blocking:04 blocking:04 quite:08 function:08 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"... Thanks, Reed