[FFmpeg-devel] [PATCH] lazily create threads in pthread.c
Sun Aug 12 20:04:40 CEST 2007
On Sun, Aug 12, 2007 at 01:47:25PM -0400, Alexander Strange wrote:
> This patch changes pthread.c so that threads aren't created until execute()
> requests them.
> This way, you can unconditionally call avcodec_thread_init() and not have
> unused threads lying around if they aren't used.
You forgot to say what the advantage is supposed to be...
> It could also save one worker thread by reusing the main thread, instead of
> sleeping it; I'll probably look at that later.
Again, advantage? I think any halfway recent OS is designed to easily
handle hundreds of threads, I can't imagine ffmpeg using e.g. 4 instead of 5
threads will gain much if anything.
More information about the ffmpeg-devel