Re: Idle processing
Re: Idle processing
- Subject: Re: Idle processing
- From: email@hidden
- Date: Tue, 25 Feb 2003 09:26:25 +0100
The low-priority tasks I'm referring to are generally
presentation of non-critical information to the user like status
displays and meters.
I'm using the GUI thread for this. When cpu load is heavy, the
trigger from my event loop timer are fired less frequently than
when cpu load is light.
Audio task are very likely to stop the GUI thread, but rarely
the opposite is true.
In my plugs, I can see that when cpu load is heavy, vu meters
does not refresh as often as when cpu load is light.
This information should be presented to the
user, but is lower priority than audio processing, so it should
be performed only if time is available after doing audio processing.
...if you need that task to schedule synchronously to the audio
processing. Is that what you need ?
To implement such a thing, two elements are required:
1) A way to convey information from the model layer to the view layer
2) A way to schedule the low priority task so it doesn't interfere
with the higher priority task of audio processing.
Number one can be accomplished by the plugin with a variety of
mechanisms including message queues and property queries (triggering
a GUI update from the audio thread would be a bad thing indeed!).
Actually I notify my GUI thread that it should ask for a GUI update.
Number
two however, requires the supervision of the host. Only the host
knows how busy it is, and therefore whether low priority tasks should
be scheduled or not. The result is that low-priority tasks will be run
less frequently when cpu load is heavy.
The host has a very deterministic view of the way it could be
scheduled. However the statistical view of MacOS GUI thread
isn't enough ?
This isn't really a VST-ism, but rather is the nature of many real-time
systems. All sequencers have such a system built-in for updating their
own displays. On the mac, this typically happens by running the high
priority thread at interrupt level and letting MacOS run the
low-priority thread between interrupts.
I'm very sorry, but it seems to me that even a event loop timer
(not the idle one I admit) is what you're looking for :
- low priority based on statistical MacOS system scheduler
- synchronous to GUI thread, so your DSP engine just have to
notify your event loop that it should ask for an update
So, is it true that there is no such priority scheduling
of tasks in audio units?
It seems that I'm mistaken. I would really like to know why,
since it is that way I handle vu-meters !
Raf
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.