On Thursday 21 August 2008 13:42:03 Krzysztof Foltman wrote: > Jakob Lund wrote: > > I've been trying to make deleting instruments during playback crash- and > > x- run-free (it's fun to switch back and forth between different kits > > while a song is playing.) I haven't succeeded yet (actually I'm way off I > > think :-s ): > > If Hydrogen is allocating memory via standard heap in RT thread, then > it's not 100% RT-safe. You could use a custom allocator, but I doubt > it's a good idea to do it before 0.9.4 is released.
Currently we are using `new Note` within the RT thread; this is not 100% RT- safe, and we ought to look at that later (e.g. a custom allocator), but definitely not before 0.9.4. > > Crash-free is (obviously) very important and not very hard. On the other > hand, 100% RT-safe may be quite tricky. Earlier versions didn't `delete` Instrument objects at all, because Note objects that reference them _might_ still live in the sequencer-, midi- or sampler note queues. I'm trying now to mark each instrument that has a not in one of these queues, and then postpone deletion of Instrument until it's no longer marked. I want the `delete` operations to be carried out from a different thread; in that case it ought to be RT safe I reckon. Currently it's quite hard, but it'll resolve in due time I'm sure. If you wanna try debugging it I'll send you the code ;-) (debugging other people's incomplete code can be tiresome though) > > Krzysztof > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge Build the coolest Linux based applications with Moblin SDK & win > great prizes Grand prize is a trip for two to an Open Source event anywhere > in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Hydrogen-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/hydrogen-devel ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Hydrogen-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hydrogen-devel
