Re: [AD] Allegro in a multithreaded way

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Thanks for your suggestion, AJ, but that doesnt seem to be the problem. Actually I feel a bit stupid. The code was one of those random memory errors.. I finally traced it to this line:

if ( which_letter > caps.size() )
   which_letter = 0;

when it should have been

if ( which_letter >= caps.size() )
   which_letter = 0;

Too bad I didnt catch this in Linux.. oh wel.


i use allegro, pthreads, and windows threads at the same time. so its OK to be using pthreads. allegro has many global variables, that can not be accessed by multiple threads. i "suggest" that you create a global lock/mutex thingy that locks any use of allegro functions. note: i only *suggest* this approach, its not a nice way, but its the only way i can see it working.




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/