Re: thoughts on smp
Steve Lhomme <[email protected]> Sun, 22 Feb 2004 16:02:53 +0100
| Newsgroups | gmane.comp.multimedia.media-api |
|---|---|
| Message-ID | <[email protected]> |
Enrico Weigelt wrote: > Hi folks, > > > does anyone know how SMP exactly works ? > > If really wanna benefit from SMP, we IMHO need MT, so the kernel > has multiple tasks it can put on several CPUs. > > Now's the big question: how should the process be splitt off best ? > Running audio and video in (real) parallel is perhaps not the best > solution, since video requires much more power than audio. So perhaps > we should split timewards instead of streamwards, in other words: > several frames are decoded/rendered at the same time. > > We also agreed that we wanna have point of MT out of the media-api, > so what interface should we provide to the application that this > can work ? To make use of SMP machines efficiently (or virtual SMP, like the P4 with HyperThreading) you either need 2 processes (or more) to run at the same time or 2 threads (or more). The first one is not very usefull in our cases, because it means splitting an application in processes... So that means using threads with some synchronisation where needed. The thread issue was already discussed here and we came to the (temporary) conclusion that it should not be mandatory but possible inside a filter/codec. Maybe the audio mixer and video mixer would probably be the one where it really make sense to have threads+sync. Having as many threads as you have inputs/outputs... BTW that also add a constraint on filter inside the media-api. They have to be thread-safe to be usable from many threads at the same time.