Hello maarten and dmitry and the rest,
thanks for the quick answers.
Faster means, that the workerthread is called more often than the jackthread
and that the workerthread can possible fill more data then jack will need.
So i try the semaphore wake thing . first i must read about semophores. never
had used them before.
this will take some minutes .
sizu c~
Am Freitag 14 Juli 2006 12:16 schrieb mdeboer(a)iua.upf.edu:
Hi Conrad,
Now the question:
- The worker thread is faster then the jackthread. (Sure, it should be).
Faster, but it might be irregular. That's what determines the ringbuffer
size.
What
is the usual way to pause the workerthread and wake up again, when the
ringbuffer needs more data.
I use usleep, though I am suppose that's a bit crude.. Is the ringbuffer
full? Then sleep a little bit. If not, read N samples from disk and write
it in the buffer.
-Which size should the ringbuffer have.
I think this depends on many factors, such as hard disk speed.
- H oxw should the ringbuffer be initilized when
starting to play?
- Any small program to have look into or a good inroduction into
pthreads?.
Another question is: how much time in advance should the workerthread
start reading, in order the have the first buffer filled when the
playerthread needs it?
I also observed that launching a thread can take a long time (esp. on
MacOSX), so I suppose you want to have the workerthread launched in
advance, and make it start reading when you need it.
maarten