>On Tue, 2003-11-18 at 23:59, Paul Davis wrote: > >> > - Conditionally compiled two thread implementation for NPTL (possibly >> > also works with LinuxThreads, untested) >> >> would you mind explaining why you are using 2 threads? it seems >> pointless, but perhaps i'm missing something... > >One is for input and other one is for output. It is especially useful >when input and output goes through different device/driver/hardware and >also for SMP. Just allows simultaneous system calls.
if you used poll(2) or select(2), you could do simultaneous waits on each direction, regardless of whether they use different devices or not. you'd then reduce the context switches and the overhead of synchronize(). you could also use the standard no-thread support infrastructure that JACK now contains, consolidating our ability to move all JACK drivers forward together. i also note that you're also not using mmap, resulting in extra copying of significant quantities of data on every cycle for multichannel cards. the cpu cycles for this can be significant when you get down to very low latency on hammerfall cards, for example. i'm not trying to argue against your design - in some ways, its quite clever. its just that it goes in a different direction than the ALSA driver does; not entirely suprising given the differences between OSS and ALSA. i didn't really sense an answer to my question about your willingness to maintain your OSS driver in the face of any future changes in JACK. if i can get a clear answer on this, i'll make a decision about adding it to CVS. --p