From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Patch to trunk: merge common code in hourglass impl Date: Wed, 04 Jun 2008 23:38:18 +0200 Message-ID: <48470B4A.5040201@gmail.com> References: <484660F1.2070609@gnu.org> <484709B0.9060804@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1212615537 27383 80.91.229.12 (4 Jun 2008 21:38:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Jun 2008 21:38:57 +0000 (UTC) Cc: Eli Zaretskii , adrian.b.robert@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 04 23:39:38 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K40hi-0002da-Kk for ged-emacs-devel@m.gmane.org; Wed, 04 Jun 2008 23:39:34 +0200 Original-Received: from localhost ([127.0.0.1]:47177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K40gw-0002dM-3s for ged-emacs-devel@m.gmane.org; Wed, 04 Jun 2008 17:38:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K40gr-0002cf-89 for emacs-devel@gnu.org; Wed, 04 Jun 2008 17:38:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K40gq-0002cC-BB for emacs-devel@gnu.org; Wed, 04 Jun 2008 17:38:40 -0400 Original-Received: from [199.232.76.173] (port=39134 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K40gq-0002c8-7h for emacs-devel@gnu.org; Wed, 04 Jun 2008 17:38:40 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]:34588) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K40gg-0004Ah-Nx; Wed, 04 Jun 2008 17:38:31 -0400 Original-Received: from c83-254-145-59.bredband.comhem.se ([83.254.145.59]:65303 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1K40gf-0002tv-7B; Wed, 04 Jun 2008 23:38:29 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <484709B0.9060804@gnu.org> X-Antivirus: avast! (VPS 080604-1, 2008-06-04), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.145.59 X-Scan-Result: No virus found in message 1K40gf-0002tv-7B. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1K40gf-0002tv-7B 1266a3b0a9a30cd9339517c0aad2116f X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:98428 Archived-At: 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)?