From: Likai Liu <liulk@bu.edu>
To: Damien Doligez <Damien.Doligez@inria.fr>
Cc: Likai Liu <liulk@bu.edu>, caml-list@inria.fr
Subject: Re: [Caml-list] PortAudio on ocaml
Date: Sat, 19 Jul 2003 09:37:05 -0400 [thread overview]
Message-ID: <15DA5D92-B9EE-11D7-B81F-000393C43D24@bu.edu> (raw)
In-Reply-To: <9368FA18-B7AE-11D7-8073-0003930FCE12@inria.fr>
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]
> > 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
[-- Attachment #2: Type: text/enriched, Size: 1067 bytes --]
<excerpt><fontfamily><param>Courier</param>> 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.</fontfamily>
</excerpt>
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
next prev parent reply other threads:[~2003-07-19 13:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-14 20:55 Likai Liu
2003-07-15 0:37 ` SooHyoung Oh
2003-07-15 2:12 ` Likai Liu
2003-07-16 9:55 ` Xavier Leroy
2003-07-16 11:59 ` Likai Liu
2003-07-16 16:57 ` Damien Doligez
2003-07-16 17:46 ` Likai Liu
2003-07-18 13:32 ` Damien Doligez
2003-07-19 13:37 ` Likai Liu [this message]
2003-07-22 11:17 ` Damien Doligez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15DA5D92-B9EE-11D7-B81F-000393C43D24@bu.edu \
--to=liulk@bu.edu \
--cc=Damien.Doligez@inria.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox