From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 1/7] gnulib substrate for ns-resolution time stamps Date: Fri, 01 Jul 2011 20:39:05 +0300 Message-ID: <83sjqprjd2.fsf@gnu.org> References: <4E0D704F.4070304@cs.ucla.edu> <4E0D81DB.3060401@cs.ucla.edu> <8339iqs0vb.fsf@gnu.org> <4E0DF555.3010005@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1309543277 24914 80.91.229.12 (1 Jul 2011 18:01:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 18:01:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 01 20:01:13 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qci1h-0000BL-IT for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2011 20:01:13 +0200 Original-Received: from localhost ([::1]:53645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qci1g-0006dJ-GU for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2011 14:01:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QchgL-0001Dr-Cf for emacs-devel@gnu.org; Fri, 01 Jul 2011 13:39:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QchgH-0006wH-OG for emacs-devel@gnu.org; Fri, 01 Jul 2011 13:39:09 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:61350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QchgH-0006vA-6x for emacs-devel@gnu.org; Fri, 01 Jul 2011 13:39:05 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LNO003000X2S900@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Fri, 01 Jul 2011 20:39:03 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.8.216]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LNO003UM112SI00@a-mtaout22.012.net.il>; Fri, 01 Jul 2011 20:39:03 +0300 (IDT) In-reply-to: <4E0DF555.3010005@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141392 Archived-At: > Date: Fri, 01 Jul 2011 09:27:01 -0700 > From: Paul Eggert > CC: emacs-devel@gnu.org > > > Could you perhaps tell more about the changes, and what they > > should provide on Windows that we don't already have? > > They let Emacs set file ns-resolution file stamps as well. > And get the time of day to ns resolution. And set delays > to ns resolution. Yes, I understand the motivation. But given that the Windows system clock is millisecond resolution anyway, we cannot really take advantage of that, can we? So all that needs to be done on Windows is scale the times in nanosecond units, i.e. multiply the current values by 1000. The rest of the complexity is not really useful, right? > The Windows emulation for will need to define struct > timespec, if it doesn't already. Which functions require that, and why? > The Windows port should set high-resolution file time stamps. For which primitives? Note that copy-file already uses a Windows-specific API which takes care of copying the file time stamp correctly. > Does Windows support a BSD-style nanotime () or POSIX-style > clock_gettime (CLOCK_REALTIME, x)? No. We can write their emulations, but again: given the 1 to 10 millisecond resolution of the Windows system clock, why is that a good idea? Just taking the result of gettimeofday and multiplying the microseconds by 1000 will give us the same result for much less effort. > Does Windows support a POSIX-style pselect ()? No. Again, since the time resolution is milliseconds, there's no real difference between pselect and select, apart of the signature. We will not be able to wait less than 1 millisecond. > Alternatively, you can simply compile lib/pselect.c, which will use > the Windows select() emulator I don't think this will work. Emacs uses its own emulation of `select'; replacing it with gnulib's will not work out of the box.