<?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/8961f54b5c536bc48f90bc349e8fdda8"
  from="Likai Liu &lt;liulk@b...&gt;"
  author="Likai Liu"
  date="2003-07-16T12:00:36"
  subject="Re: [Caml-list] PortAudio on ocaml"
  prev="2003/07/c5e526596332cf6571a2af65d85c1723"
  next="2003/07/c32767f41b4444441894ba0b93d99b0d"
  prev-in-thread="2003/07/c5e526596332cf6571a2af65d85c1723"
  next-in-thread="2003/07/906539e8aefc2fb1784a561f5bc15d56"
  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>

On Wednesday, July 16, 2003, at 05:55  AM, Xavier Leroy wrote:

&gt; That's the crux of the problem, indeed.  I looked at the PortAudio
&gt; tutorial and found this little gem:
&gt;
&gt;   Your callback function is often called by an interrupt, or low level
&gt;   process so you should not do any complex system activities like
&gt;   allocating memory, or reading or writing files, or printf(). Just
&gt;   crunch numbers and generate audio signals.

I'm giving a bit leeway on the activities that allocate memory, since 
most of the time it's just manipulation of some data structure in 
memory. Granted, it might cause hard-disk activity every once in a 
while for thrashing, but even simple memory access could cause this 
too. Also, note that the restriction is tight on some platforms but not 
so tight on others. I was hoping at least this would work on these not 
so stringent systems. However, I think invoking system calls that block 
the callback for possibly unspecified amount of time is the forbidden 
game.

I think garbage collection inside the callback is probably okay, if it 
doesn't do other fancy things, such as dispatching signals or influence 
thread scheduling. What does O'Caml runtime do during garbage 
collection?

&gt; - Event loops (register Caml callbacks, then enter a library-provider 
&gt; event
&gt;   handler that will block and invoke the callbacks one at a time,
&gt;   but not from a signal or interrupt context).

That's also a possibility; does it play well with O'Caml Threads?

Thanks for the response.

liulk

-------------------
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

</contents>

</message>

