Hi!

> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Im Auftrag von 
> Phil Endecott
> Gesendet: Montag, 01. Jänner 2007 15:58
> An: [email protected]
> Betreff: [directfb-users] Multi-threaded directfb apps
> 
> Dear All,
> 
> Can anyone offer any advice about the requirements for 
> multi-threaded DirectFB applications?
> 
> I.e., if two threads both need to access the directfb system 
> (to create surfaces, decode JPEGs, blit to the screen etc), 
> does directfb do the necessary locking, or must the 
> application do this?  If it's the application's 
> responsibility, what operations cannot be concurrent?
> 

If you use more than one DFB process and the multi-application feature of DFB 
(--enable-multi when compiling), the different processes will use the fusion 
kernel module to communicate, and access to DFB structures will occur in a safe 
way.

If accessing the same DFB structures from multiple threads of the same process, 
my guess is that you will have to synchronize everything quite carefully 
yourself.
One exception should be the DFBSurfaces, and drawing to them. By using the 
DFBSurface->Lock() function you should be able to synchronize the actual 
drawing operations.

At least that's my understanding of the situation.

Richard Unger

> In my case, I have a pan/zoom user interface for viewing a 
> collection of images.  The main thread receives mouse motion 
> events and stretch-blits images from their individual 
> surfaces to appropriate places on the screen.  A second 
> thread is responsible for "background" 
> loading of JPEGs into those surfaces.  This works most of the 
> time but I get some odd crashes.  I have locks around the 
> application data structures that the threads use to 
> communicate with each other, but currently it's possible for 
> both threads to call CreateSurface simultaneously.
> 
> Any suggestions would be most welcome.
> 
> Regards,
> 
> Phil.
> 
> (You are welcome to CC me in any replies.)
> 
> 
> 
> 
> 
> _______________________________________________
> directfb-users mailing list
> [email protected]
> http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
> 

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to