[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to trunk: merge common code in hourglass impl

From: Jason Rumney
Subject: Re: Patch to trunk: merge common code in hourglass impl
Date: Wed, 04 Jun 2008 22:31:28 +0100
User-agent: Thunderbird (Windows/20080421)

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]