[parsec-users] x264 Threading Model

Yungang Bao ybao at CS.Princeton.EDU
Mon Apr 25 11:56:13 EDT 2011


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


More information about the parsec-users mailing list