[vdr] Making a cList object thread safe?

Stefan Huelswitt s.huelswitt at gmx.de
Sun Aug 20 11:06:16 CEST 2006


On 20 Aug 2006 Christian Wieninger <cwieninger at gmx.de> wrote:

> what is the best way to make a cList derived object thread safe?

You have to protect all functions of your object which are
dealing with the list (reading and/or writing) with a cMutex.

Alternatively you could use a cRwLock, but this is more
complicated. It should be the prefered solution if you have a lot
concurrent read accesses but only few writes (e.g. like EPG
data).

> There are already some synchronisation methods in VDR (cMutex, 
> cThreadLock,...). Is there any preferred method to solve my problem? Is 
> there any plugin that already handled and solved this?

I think there are a lot, e.g. MP3 plugin.
But VDR core it self has some examples, e.g. cRemote or
cCaDescriptorHandler

Regards.

-- 
Stefan Huelswitt
s.huelswitt at gmx.de  | http://www.muempf.de/



More information about the vdr mailing list