![]() |
|
[A4/A5] How thread safe is Allegro? |
Chris Katko
Member #1,881
January 2002
![]() |
Both Allegro 4, and Allegro 5? How thread safe are we talking about? Can I blit to multiple bitmaps at the same time? Can I load files at the same time? What happens when I blit to different sections of the same bitmap? (Mutex locked, I assume?) -----sig: |
Gideon Weems
Member #3,925
October 2003
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
I don't think A4 gives much thought to user threads. Some parts of the implementations use threads behind the scenes, but even then its a bit sketchy from what I remember. Locking is totally up to you. As for A5, it was designed to be thread safe. Much state is stored in thread local variables. You can draw with hw in two different threads if you have two separate contexts set up. Otherwise you're stuck to a single thread drawing on a context at a time, with other threads using software. -- |
SiegeLord
Member #7,827
October 2006
![]() |
The nicest thing you can say about this is that Allegro5 aspires to be thread safe. It's straightforward to find parts that can race each other, however. I don't think many of those things can or should be fixed, but rather a better approach is to examine the common use cases and make sure they don't have thread-safety issues. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|