Thread: Avisynth 2.6 MT
View Single Post
Old 19th May 2012, 14:26   #400  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
That's not how it works. Simplified a bit, it works this way: let's look at certain filter in the script in MTMode – there are indeed 2 threads, but both of them have all source frames, next from one thread frames 0,2,4... are requested and from the other thread frames 1,3,5... If the filter handles non-sequential requests correctly – it'll work exactly as in non-MT mode, but if it doesn't – things will break (note that they will also break in non-MT mode when some filter reorders frames like SelectEven or Trim).

The end
Code:
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last
must be used only for certain cases like ffdshow processing, for plain Avisynth usage it must not be used. How to guess? If MTMode doesn't change your CPU utilization no matter how many threads you request, but adding Distributer helps – you need it, otherwise you don't.
SEt is offline   Reply With Quote