|From:||Lennart Borgman (gmail)|
|Subject:||Re: Patch to trunk: merge common code in hourglass impl|
|Date:||Wed, 04 Jun 2008 23:38:18 +0200|
|User-agent:||Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:184.108.40.206) Gecko/20071031 Thunderbird/220.127.116.11 Mnenhy/0.7.5.666|
Jason Rumney wrote:
Eli Zaretskii wrote:Yes, atimers work by sending SIGALRM, which isn't supported on Windows. While Windows has equivalent functionality, no one stepped forward to emulate atimers, probably because their use in Emacs is quite limited, and in areas where Windows offers alternate ways of doing the same.What is the equivalent functionality? Threads are not the same as signals, as they do not block other threads from executing. This is a problem when any Lisp code is run, as a GC can occur in the main Lisp thread while the signal emulation thread is running Lisp code, leading to memory corruption and crashes. So any system timers need to be handled in the Lisp thread, which effectively means they are synchronous. Since the hourglass code doesn't actually need to run Lisp, I used a Windows system timer running in the UI thread, which is not generally busy enough to have delays like the Lisp thread, but I don't think a general atimer implementation can be done that way.
Is it not possible to use critical sections (which is like a low cost in process semaphore)?
|[Prev in Thread]||Current Thread||[Next in Thread]|