7771139cdf
* The first problem was the O(n^2) complexity of the algorithm, it's now linear and try to act in a circular way by dispatching events and reading the port in a balanced way. This exclude a certain degree of possible deadlocks. * Add detection and escape when the system try to kill the thread. This solve some blocking issues on exit et similia that i had with libjackcompat. * The algorithm choose soon which event to focus on. * Lateness is calculated just before the event is dispatched as it is the more appropriate place, otherwise we would be calculating something imprecise/guessed. * Remove timed_event_queue::queued_time. It's more precise to just use the RealTime() before to Dispatch the event. * It should solve the BSoundPlayer lateness problems. * With those improvements the media_kit is not going to lock completely under stress conditions, instead it try to work in a best effort shape. * There's still room for improvements, for example i'm considering some strategies in lateness situations such as update scheduling latency, try to decrease waiting time and detect when we are too early on the other hand to recover when the load go down. * Thanks to Julian Harnath for sharing his WIP patch which helped with some controls such as avoiding negative lateness. * Comments are welcome! |
||
---|---|---|
.. | ||
add-ons | ||
app | ||
arch | ||
be_apps | ||
bluetooth | ||
device | ||
drivers | ||
game | ||
interface | ||
kernel | ||
locale | ||
media | ||
midi | ||
midi2 | ||
net | ||
package | ||
storage | ||
support | ||
translation | ||
AppKit.h | ||
Be.h | ||
BeBuild.h | ||
DeviceKit.h | ||
GameKit.h | ||
InterfaceKit.h | ||
KernelKit.h | ||
LocaleKit.h | ||
MailKit.h | ||
MediaKit.h | ||
MidiKit.h | ||
NetKit.h | ||
NetworkKit.h | ||
StorageKit.h | ||
SupportKit.h | ||
TranslationKit.h |