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



Seth,

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

Does an 'imdc' component using the Base Decompressor need to do anything special to support hyperthreading?

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

Thanks for your reply. However, what I want to know is not how to implement threading on Windows, but whether QuickTime's Base Decompressor, which already implements threading for the frame-drawing function ImageCodecDrawBand(), can handle hyperthreading. We are finding that our SheerVideo decoders, which use the Base Decompressor, hang when and only when hyperthreading is turned on. Ordinary multithreaded and multiprocessor environments do not exhibit this problem.

The easiest way (and in our case the best way) for an image decompressor to support threading is to implement the 'ImageCodecGetMPWorkFunction()' function, which allows it to perform asynchronous decompression in a single MP task by taking advantage of the Base Decompressor. For this to work, the 'ImageCodecDrawBand() function must be both thread-safe and MP-safe, which means it must not call any routines that move or purge memory or cause 68K code to be executed. SheerVideo's DrawBand() functions are thread-safe because they do not refer to any global variables or component-instance variables; they refer only to thread-specific (ImageSubCodecDecompressRecord) variables. And they are MP-safe because they do not make any API calls whatsoever.

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)
 >Re: Hyperthreaded Decompressor (From: Seth Porter <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.