From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA24773; Tue, 22 Jul 2003 13:17:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA05364 for ; Tue, 22 Jul 2003 13:17:55 +0200 (MET DST) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6MBHsf18351 for ; Tue, 22 Jul 2003 13:17:54 +0200 (MET DST) Received: from spi.lip6.fr (spi.lip6.fr [132.227.83.193]) by isis.lip6.fr (8.12.9/jtpda-5.4+victor) with ESMTP id h6MBHqZS014164 ; Tue, 22 Jul 2003 13:17:52 +0200 X-pt: isis.lip6.fr Received: from inria.fr ([132.227.66.219]) by spi.lip6.fr (8.11.6/jtpda-5.2) with ESMTP id h6MBI0P26831 ; Tue, 22 Jul 2003 13:18:00 +0200 Date: Tue, 22 Jul 2003 13:17:48 +0200 Subject: Re: [Caml-list] PortAudio on ocaml Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: caml-list@inria.fr To: Likai Liu From: Damien Doligez In-Reply-To: <15DA5D92-B9EE-11D7-B81F-000393C43D24@bu.edu> Message-Id: <2023420A-BC36-11D7-AD7F-0003930FCE12@inria.fr> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.552) X-Scanned-By: isis.lip6.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; damien:01 caml-list:01 liu:99 waits:01 threads:01 callbacks:01 callback:01 ocaml:01 caml:01 blocking:01 bytecode:01 doligez:01 native:02 thread:02 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Saturday, July 19, 2003, at 03:37 PM, Likai Liu wrote: > So what about the alternative option, as Xavier suggested earlier, to > enter an event loop that that waits in an "enter_blocking_section" > call with threads but no other running threads, and then callbacks are > made during the loop one at a time? You would have a Caml thread that does "enter_blocking_section" to release the master lock, then wait for callbacks. When a callback occurs, you need to "leave_blocking_section", do the work, then "enter_blocking_section" again before returning from the callback. > Speak of which, if I write a C function that blocks, does the bytecode > thread scheduler know how to schedule other threads during the mean > time? And native threads? This is the whole purpose of the "enter_blocking_section" and "leave_blocking_section" calls: to tell the scheduler that it can schedule another thread. -- Damien ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners