Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hyperthreaded Decompressor



Hi Steve,

Is the Base Decompressor thread-safe with respect to hyperthreading?

Is there anything special an 'imdc' component using the Base Decompressor needs to do to support hyperthreading?

Hyperthreading to a programmer looks much like a multiprocessor box. Have you supported multiprocessors ala QuickTime 5? (For some doc on this see the QuickTime5.pdf in your Xcode doc folder) I think that is also supported in the Windows version of QuickTime, so you now have hyperthreading support.

Thanks for the pointer to QuickTime.pdf; I hadn't seen that document. But yeah, we already do this. The problem is that while it works for multiple processors and ordinary multithreading on both Mac and PC, it doesn't work for hyperthreading.

The one thing to be careful about is the "dual" cpus share the same cache and execution units. Since the P4 architecture has a really deep pipeline (20 stages or more now) a branch prediction miss means the processor stalls and has nothing to do (some would argue cooling off is doing something :-). Hyperthreading is an attempt to give it something to do. By having some other instructions sitting ready to go, the CPU will switch and execute those. If your code is scheduled well and has few pipeline stalls, then you are already maxing out the execution units in the CPU, and supporting threading may decrease performance (due to cache contention, etc)

SheerVideo is almost always data-starved, so the CPU does stall. And for decompression, QuickTime likes to queue up a whole bunch of frames for asynchronous decompression so they'll be ready in time even if other processes cause dips in CPU availability.

Should an image decompressor using the base decompressor advertise that it's 'cmpThreadSafe' in a hyperthreading environment on Windows?

I suspect that the current QuickTime 6.5 doesn't support cmpThreadSafe on Windows, since that would involve making the QTML managers thread safe, which they did in Panther.

Hmm, so it sounds like maybe we'll have to "fix" the problem by disabling multiprocessor support on Windows. That would be sad.

Andreas Wittenstein
BitJazz Inc.
http://www.bitjazz.com/sheervideo/
_______________________________________________
quicktime-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-api
Do not post admin requests to the list. They will be ignored.


References: 
 >Capture images from a sequence grabber in planar format (From: Bing-Chang Lai <email@hidden>)
 >Hyperthreaded Decompressor (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.