Re: [AD] x color conversion again (w/ responsiveness patch) |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Elias Pschernig wrote:
Well. My theory is: *Something* in the asm-color-converters doesn't get preserved over an interrupting signal. I.e., the signal enters somewhere inside the asm, and therefore, a register or flag is modifed. Or, since we do no X11 locking in the signals version, the memory the asm converters are accessing is volatile and is invalidated when a signal occurs?
Hmm.. googling for 'how linux signals work', I ran across this: http://www.linuxjournal.com/article.php?sid=3985This quote here seems to indicate that the signal is indeed being called from a different context, if not a different thread:
"The occurrence of a signal may be synchronous or asynchronous to the process or thread, depending on the source of the signal and the underlying reason or cause. Synchronous signals occur as a direct result of the executing instruction stream, where an unrecoverable error (such as an illegal instruction or illegal address reference) requires an immediate termination of the process. Such signals are directed to the thread which caused the error with its execution stream. [...]
Asynchronous signals are external to (and in some cases, unrelated to) the current execution context. One obvious example would be the sending of a signal to a process from another process or thread via a kill(2), _lwp_kill(2) or sigsend(2) system call, or a thr_kill(3T), pthread_kill(3T) or sigqueue(3R) library invocation. Asynchronous signals are also aptly referred to as interrupts."
If SIGALRM is also asynchronous, then that means we'd definately have problems calling X routines from it. Also, the rest of the document leads me to believe that signals do indeed have the same stack trappings as a hardware interrupt.. ie. no FPU stack. I tried asking Bob in #allegro if MMX would have the same problems, but he's not around. It does make sense since I compiled Allegro with -mmmx which enables MMX usage in the produced asm, which includes the signal handlers.
I'll try building the signal version of 4.1.14 and let you guys know how it goes.
- Kitty Cat
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |