traverso-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-devel] 0.30.0 and thread save object handling


From: Remon Sijrier
Subject: [Traverso-devel] 0.30.0 and thread save object handling
Date: Tue, 27 Jun 2006 12:33:09 +0200
User-agent: KMail/1.9.3

Hello list,

A thing which has been badly missing in Traverso is thread save 
adding/removing of objects that are shared accross threads.

All objects that take part in the audio processing execution path (like Song, 
Track, AudioClip, Plugins and so on) were added/removed to their respective 
owners without taking care if it was done thread save.

This could result in crashes, which is bad of course!
On a single cpu system it's rather hard to trigger one, but on multipe cpu 
systems it should be fairly easy to do so!

It was most easily triggered when adding Song's into the audio processing 
thread (either the alsa or jacks one), and I baked up a solution which add's 
it thread save, and in such a way the audiothread will never block on an "Add 
song" request.

However, it wasn't a generic solution, so last days I moved it to a seperate 
class, which gives much more controll, but more importantly, all Objects 
which are shared accross threads now can be added/removed in a thread save 
way by one call!
I've put the call into a macro to be able to add some debugging/other stuff 
automatically.

The macro looks like this (for the interested):

THREAD_SAVE_ADD(ObjectToAdd, ObjectToAddTo, "function_name");
THREAD_SAVE_REMOVE(ObjectToRemove, ObjectToRemoveFrom, "function_name");

Since the initial stuff I wrote for adding/removing Songs worked, at least I 
never had problems with it, and it's pretty important, the generic solution 
which uses the same mechanism has been uploaded to CVS, and wil be part of 
0.30.0 (despite the feature freeze we have)

I tested it as much as possible, though I think some more testing by you 
couldn't harm :-)

Please report anything which seems to work different as it was before!

Thanks,

Remon

It at least solved the "crashing when setting shape of a fade when playcursor 
is in fade range while playing" for me :-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]