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 PAA02205; Sat, 19 Jul 2003 15:37:41 +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 PAA05637 for ; Sat, 19 Jul 2003 15:37:40 +0200 (MET DST) Received: from acsn03.bu.edu (acsn03.bu.edu [128.197.159.63]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6JDbcf29346; Sat, 19 Jul 2003 15:37:39 +0200 (MET DST) Received: from bu.edu (bays193-0b01-dhcp060.bu.edu [168.122.153.60]) by acsn03.bu.edu ((8.9.3p2.buoit.v1.3)/BU_Server-1.3) with ESMTP id JAA313016; Sat, 19 Jul 2003 09:37:05 -0400 Date: Sat, 19 Jul 2003 09:37:05 -0400 Subject: Re: [Caml-list] PortAudio on ocaml Content-Type: multipart/alternative; boundary=Apple-Mail-2-857730131 Mime-Version: 1.0 (Apple Message framework v552) Cc: Likai Liu , caml-list@inria.fr To: Damien Doligez From: Likai Liu In-Reply-To: <9368FA18-B7AE-11D7-8073-0003930FCE12@inria.fr> Message-Id: <15DA5D92-B9EE-11D7-B81F-000393C43D24@bu.edu> X-Mailer: Apple Mail (2.552) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; liu:99 caml-list:01 callback:01 waits:01 threads:01 callbacks:01 ad-hoc:01 fontfamily:01 ocaml:01 garbage:01 blocking:01 bytecode:01 native:02 thread:02 o'caml:02 X-Attachments: type="text/enriched" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --Apple-Mail-2-857730131 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed > > is a "leave_blocking_section()" call enough to guarentee that? > > If the callback is invoked in a thread, yes. But then you are back > to square 1: leave_blocking_section will wait for the master lock, > and your program is not real-time. 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? I think at the end, more speculation probably won't help much. I think I should just try different ways and do ad-hoc experiments to see which ones actually work acceptably, in the presence of garbage collection, interrupting signals, other threads, etc. If none of them work, at least there is a blocking I/O interface left for O'Caml. 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? liulk --Apple-Mail-2-857730131 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=US-ASCII Courier> is a "leave_blocking_section()" call enough to guarentee that? If the callback is invoked in a thread, yes. But then you are back to square 1: leave_blocking_section will wait for the master lock, and your program is not real-time. 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? I think at the end, more speculation probably won't help much. I think I should just try different ways and do ad-hoc experiments to see which ones actually work acceptably, in the presence of garbage collection, interrupting signals, other threads, etc. If none of them work, at least there is a blocking I/O interface left for O'Caml. 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? liulk --Apple-Mail-2-857730131-- ------------------- 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