[parsec-users] x264 Threading Model

Sudhanshu Shukla sudhan345 at gmail.com
Wed Apr 27 06:24:32 EDT 2011


Hi,

I also located that two threads are being created for each frame.
In Christian Bienia's thesis it is specified that x264 creates a virtual
pipeline with as many stages as frames.
But if each frame is creating two threads then how the threads are being
managed?


Sudhanshu Shukla




On Mon, Apr 25, 2011 at 9:26 PM, Yungang Bao <ybao at cs.princeton.edu> wrote:

> Hi,
>
> I looked into the codes. Actually, for each frame, there are two places
> where the two new threads will be created:
>
> 1) p_read_frame (...) [x264.c:858]
>   |= read_frame_thread; [x264.c:727]
>      |-> x264_pthread_create(...) [muxers.c:497]
>
> 2) Encoder_frame (...) [x264.c:872]
>   |-> x264_encoder_encode (...) [x264.c:809]
>      |-> x264_pthread_create (...) [encoder/encoder.c:1587]
>
>
>
> Yungang
>
> ----- Original Message -----
> From: "Sudhanshu Shukla" <sudhan345 at gmail.com>
> To: parsec-users at lists.cs.princeton.edu
> Sent: Saturday, April 23, 2011 6:19:15 AM
> Subject: [parsec-users] x264 Threading Model
>
>
>
> Hi All,
>
>
> I am trying to understand the threading in x264. The following post on the
> parsec-users (
> https://lists.cs.princeton.edu/pipermail/parsec-users/2009-August/000490.html) sates that
> "X264 spawns one thread per frame to encode, but no more than the number of
> threads you specify are running at once. In other words, the number of
> threads you pass to the program determines the maximum number of threads
> that exist at any time, but the number of threads that exist over the
> lifetime of the program is determined by the input video." Thus, following
> the above post, the number of threads created for the simmedium input (32
> frames) the number of threads created over the lifetime of the application
> should be 32. But when I track the number of threads created by a modified
> version of malloc_mt pintool (
> http://www.cs.virginia.edu/kim/publicity/pin/docs/39599/Pin/html/index.html#MallocMT), the number of threads created over the lifetime of the application is 64.
> Is this expected or I am missing some thing? Can somebody explain the
> threading model used in x264? Thanks Sudhanshu Shukla
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/parsec-users/attachments/20110427/1ae26673/attachment.html>


More information about the parsec-users mailing list