On Sat, Jun 26, 2004 at 09:18:03AM -0400, hx wrote:
> 
> Hi directfb-dev.
> 
> 
> 
> I've been toying with DirectFB for about a week now on an
> 
> embedded platform that uses the AMD (formerly NSC) Geode GX1.
> 
> I'm pretty impressed with DirectFB.
> 
> 
> 
> I would like to use pthreads with DirectFB.  What does it
> 
> take to do this?  The DirectFB core must be threadsafe
> 
> because it runs multiple threads.  But what about the
> 
> interfaces, particularly IDirectFBSurface structures?

They are not thread safe. With IDirectFBSurface you don't necessarily 
require any locking. You can access the same core surface with multiple 
IDirectFBSurface interfaces via IDirectFBSurface::GetSubSurface(). The 
only catch is that only the first IDirectFBSurface may use page flipping. 
Sub-surfaces will always do a back-to-front copy on Flip().

If you do your own locking around the DirectFB interfaces you should be 
able to do anything. My only personal pthread + DirectFB code was with 
mplayer where I moved the Flip() call to another thread so that the 
decoding process could continue while waiting for the flip to occur. As I 
recall it worked just fine.

-- 
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/


Reply via email to