Re: [AD] Allegro on multi-processor machines |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Evert Glebbeek wrote:
That doesn't really solve the problem of course, but it may give a hint as to what is going wrong exactly.I think the problem is that Allegro is not using proper mutex locks. What I don't understand is why this problem doesn't seem to show up on single processor machines.
AFAIK, without proper thread synchronisation, two caches may have different ideas about the contents of the same memory address, e.g. one thread updates a global variable X, but the other thread still sees the old value for X. I read that Allegro's mouse would "stall" on multiprocessor machines (before the program crashed, that is :-). This could be one explanation. I just saw that mouse_x,y are marked volatile, but not the internal variables _mouse_x,y.
Also, on a single processor machine threads never *really* run in parallel. I think Allegro can get away with a lot more dodgy practices then.
Also, can someone please explain again why with the following definitions
[snip]
XLOCK() and XUNLOCK() don't block indefinatebly?
When a signal handler is called, the process is suspended for its duration. When the signal handler returns, the process is resumed wherever it was interrupted. So blocking the process indefinitely doesn't make sense.
Peter
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |