<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/d7c69216c33f0f4864d0f0fc53dab975"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-19T13:37:41"
  subject="Re: [Caml-list] PortAudio on ocaml"
  prev="2003/07/7f32abd85cd705b39286a3e20e116899"
  next="2003/07/e10127791c425c583a2239eb023093ef"
  prev-in-thread="2003/07/eff3f424206ab79c6f72fa50d6d55585"
  next-in-thread="2003/07/776d2c77ba72d4f7c3c9923252934201"
  prev-thread="2003/07/c35ce3ef11d645eaf3822cd5eb0f68c0"
  next-thread="2003/07/f087c018f2b5dd9d20cee1fec0e2932e"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/54a6ceb53dfa0bd7ef618e45a55fec76"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-14T20:55:48"
  subject="[Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/0246c867e03ce642bf18a3fcaa245116"
  from="SooHyoung Oh &lt;shoh@d...&gt;"
  author="SooHyoung Oh"
  date="2003-07-15T00:37:44"
  subject="Re: [Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/eff20a82be9cc2e2ec8b6cff76a4b7c6"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-15T02:13:36"
  subject="Re: [Caml-list] PortAudio on ocaml">
</msg>
</msg>
<msg 
  url="2003/07/c5e526596332cf6571a2af65d85c1723"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-07-16T09:55:53"
  subject="Re: [Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/8961f54b5c536bc48f90bc349e8fdda8"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-16T12:00:36"
  subject="Re: [Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/906539e8aefc2fb1784a561f5bc15d56"
  from="Damien Doligez &lt;Damien.Doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-07-16T16:57:29"
  subject="Re: [Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/f61061539242baa0c21b95280b6ad460"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-16T17:47:26"
  subject="Re: [Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/eff3f424206ab79c6f72fa50d6d55585"
  from="Damien Doligez &lt;Damien.Doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-07-18T13:32:29"
  subject="Re: [Caml-list] PortAudio on ocaml">
</msg>
</msg>
<msg 
  url="2003/07/d7c69216c33f0f4864d0f0fc53dab975"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-19T13:37:41"
  subject="Re: [Caml-list] PortAudio on ocaml">
<msg 
  url="2003/07/776d2c77ba72d4f7c3c9923252934201"
  from="Damien Doligez &lt;Damien.Doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-07-22T11:17:56"
  subject="Re: [Caml-list] PortAudio on ocaml">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
&gt; &gt; is a "leave_blocking_section()" call enough to guarentee that?
&gt;
&gt; If the callback is invoked in a thread, yes.  But then you are back
&gt; to square 1: leave_blocking_section will wait for the master lock,
&gt; 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

</contents>

</message>

