List Info

Thread: Re: jackmidi: api cleanup




Re: jackmidi: api cleanup
user name
2007-04-05 11:46:54
On Thu, Apr 05, 2007 at 12:30:25PM -0400, Dave Robillard
wrote:

> Just a random thought:
> 
> Would it be beneficial/possible for the 'wait' call and
the 'notify jack
> we're done' call, so the thread can do something in the
interim?  e.g.
> 
> while (true) {
> 	jack_wait()
> 
> 	read_input()
> 	process_things()
> 	deliver_output()
> 
> 	jack_done()
> 
> 	do_some_other_stuff()
> }

Two fundamental problems (which amount to the same one):

Who (which thread) is going to wait for the next callback ?
What if the thread is still 'doing something' when the next
callback is due ?

A thread is only a single thread, it can only be in one
place
at a time...

-- 
FA

Follie! Follie! Delirio vano è questo !



------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jackit-devel mailing list
Jackit-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jackit-dev
el

Re: jackmidi: api cleanup
country flaguser name
Canada
2007-04-05 16:19:58
On Thu, 2007-04-05 at 18:46 +0200, Fons Adriaensen wrote:
> On Thu, Apr 05, 2007 at 12:30:25PM -0400, Dave
Robillard wrote:
> 
> > Just a random thought:
> > 
> > Would it be beneficial/possible for the 'wait'
call and the 'notify jack
> > we're done' call, so the thread can do something
in the interim?  e.g.
> > 
> > while (true) {
> > 	jack_wait()
> > 
> > 	read_input()
> > 	process_things()
> > 	deliver_output()
> > 
> > 	jack_done()
> > 
> > 	do_some_other_stuff()
> > }
> 
> Two fundamental problems (which amount to the same
one):
> 
> Who (which thread) is going to wait for the next
callback ?
> What if the thread is still 'doing something' when the
next
> callback is due ?
> 
> A thread is only a single thread, it can only be in one
place
> at a time...

The extra bit would need to adhere to realtime guidelines as
well, as
mentioned.

There is only one thread we're talking about here; one
thread, one
place, one time.  It is the one that will wait for the next
callback,
via jack_wait().  If it's doing something at the time,
jack_wait() will
just return immediately.

I figure this just allows apps to shave a few ms off the
time jackd
needs to wait for them, in the case where the audio thread
has things to
do at the end of a cycle which don't actually have a direct
effect on
the output delivered that cycle (or equivalently, things to
do at the
beginning of a cycle which don't have a direct dependency on
the input
of that cycle)

That said, the benefit gained might not be applicable to
enough apps, or
significant enough to make it worthwhile.  Just a thought.

-DR-


------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jackit-devel mailing list
Jackit-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jackit-dev
el

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )