[Libav-user] Using the libav* libraries in a thread-safe manner?
alexcohn at netvision.net.il
Wed May 15 18:26:05 CEST 2013
On 15 May 2013 19:13, "Joe Flowers" <joe.flowers at nofreewill.com> wrote:
> Carl and Hendrik,
> Thank you very much for your comments and expertise.
> You are right, I'm mixing up thread-safety and re-entrantcy. Sorry.
> With Hendrik's advice on not cancelling threads to prevent a deadlock or
zombie-type threads, I'm now more concerned with thread-safeness.
> I know when I configure and make FFMPEG, there is an "--enable-pthreads"
option. If I am understanding things correctly, this particular option is
not relevant to the thread safety of a C program calling the libav* APIs,
Some codecs allow multithreaded processing to speed things up (on multicore
systems). That's where pthreads become relevant.
> I am using gcc on Ubuntu to compile and link to the libav* libraries and
am wondering if I need to use a particular "-pthreads" option (or something
else) with gcc to make sure I am using thread-safe C libraries to get a
In your toolchain, malloc is thread-safe.
> The reason I ask is because in Windoze one has to link with the
mulithreaded C libraries (*MT.lib) to get a thread-safe version of malloc().
Non-multithread RT libraries for Microsoft C compiler are long gone.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user