On Thu, 16 Oct 2003, Ryan Pavlik wrote:

> On Thu, 16 Oct 2003 19:54:20 +0200 (CEST)
> Jaroslav Kysela <[EMAIL PROTECTED]> wrote:
>
> <snip>
> > Don't use select() if possible. You don't know which direction is required
> > for a file descriptor. You must use snd_seq_poll_descriptors_revents()
> > which mangles the used direction and reports the correct one to
> > the application (and yes, it might be an opposite or both
> > directions in real if we implementing some complex devices behind this
> > API).
> <snip>
>
> Unfortunately it's necessary...  I'm trying to write a ruby module,
> and ruby uses soft threads for portability's sake.  It's also
> unfortunately not threadsafe, or I could just dump the sequencer stuff
> in a pthread and go from there.
>
> It does provide rb_thread_select(), which uses select() but schedules
> its own threads while blocking.
>
> The pollfd struct does provide the 'events' member which can have
> POLLIN and/or POLLOUT, so I should still be able to put the
> descriptors in the right group for select, no?

Yes, but you have to create revents for snd_seq_poll_descriptors_revents()
to get the right event then. Don't use values from select() directly.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to