delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/23/16:25:53

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; q=dns; s=default; b=uidBIt4K+FBenbydvaY/D63BEeAUX
jKj+gBApXeD6ntHITHTh6meS7np50rbEhsJNSTPVNdbhzFMrdUzu6xvej77+Sght
Ci1O2FvSRLY8WzHlDfZbN3GYs3qCDyfAqbMEcMNf7BgDy+5zjwKbgu/eOO1zEr1q
Jh5UnbiA1Tjj6k=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; s=default; bh=dX8VgAvVkLyXlv5b7rIiMGj8Smc=; b=I2O
qiTV2ZIALKhYlr+ZEKSkLU/rh4md9xt8Nb4ZVgmCFtZXMy/OCArkBsiacuJF0rUS
hUcgs1ba6tx5avkqLekY7bXDCrR1swyZA9CqN7nAUedJUb37ecSzwS5j8VqTzihM
RZI43n/1pa4Yx8Plv4xSlYlIIT4Bc/qLKgZjlQ50=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=careless, timer
X-HELO: NAM05-BY2-obe.outbound.protection.outlook.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4Kg4iZ5ABsX0/eBMin8Y0d5Q75uXFm1DfaElt55HoNc=; b=YoIaZtc59ObSS4MAx0ASsVjjhH9AadC2PbyV2ivZgbt7lsaZaNJuGVsxVee9LOMZ2u8qbIQ68VvtCN0l4S0rTuYT9dx+spAiiBQSn4ZKfzde03zWxEwtX5gREOy+0+e0mFEXf1yYIqdC5CbNCcWVkGQFBGtye2+Tikxz8kFcXec=
From: Ken Brown <kbrown AT cornell DOT edu>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: The timerfd functions slow down emacs
Date: Sat, 23 Feb 2019 21:24:59 +0000
Message-ID: <c316e5bd-0929-fc8a-0e3d-cc5671416866@cornell.edu>
References: <04048cc3-091a-b55c-372b-bde29273d952 AT cornell DOT edu> <1df3d7ce-1427-cbd4-0978-7236b1903440 AT cornell DOT edu> <20190223191542 DOT GS4256 AT calimero DOT vinschen DOT de> <0f2789ab-5722-c0de-6176-d4e1aaff9f81 AT cornell DOT edu> <20190223210152 DOT GA4133 AT calimero DOT vinschen DOT de>
In-Reply-To: <20190223210152.GA4133@calimero.vinschen.de>
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu;
received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x1NLPp0c031291

On 2/23/2019 4:01 PM, Corinna Vinschen wrote:
> On Feb 23 20:48, Ken Brown wrote:
>> On 2/23/2019 2:15 PM, Corinna Vinschen wrote:
>>> Below's the NSSTC I used to test my timerfd implementation (based on
>>> another STC to show a problem in POSIX timers).  From what I can tell it
>>> works as desired.  If you find a problem, please point it out or send a
>>> patch.
>>
>> Thanks, that saved me a lot of time.  I was in the process of creating a test
>> case when your mail arrived.
>>
>> Your test works fine.  For example:
>>
>> $ gcc timerfd_test.c -o timerfd_test
>>
>> $ ./timerfd_test.exe 3 1 10
>> 0.000: timer started 52379
>> 2.988: 52379 read: 1; total=1
>> 3.988: 52379 read: 1; total=2
>> 4.989: 52379 read: 1; total=3
>> 5.987: 52379 read: 1; total=4
>> 7.001: 52379 read: 1; total=5
>> 7.987: 52379 read: 1; total=6
>> 9.001: 52379 read: 1; total=7
>> 9.987: 52379 read: 1; total=8
>> 10.987: 52379 read: 1; total=9
>> 11.997: 52379 read: 1; total=10
>>
>> But if I change CLOCK_MONOTONIC by CLOCK_REALTIME in the call to timerfd_create,
>> then I get the following:
> 
> Only in timerfd_create?  Not in clock_gettime?  If you don't
> do that, you're using a different clock with entirely different
> values for the starttime.
> 
> Actually, this testcase started with CLOCK_REALTIME in both calls.
> If I revert to that, I get:
> 
> )$ ./timerfd 3 1 10
> 0.000: timer started 644
> 3.001: 644 read: 1; total=1
> 4.001: 644 read: 1; total=2
> 5.017: 644 read: 1; total=3
> 6.001: 644 read: 1; total=4
> 7.001: 644 read: 1; total=5
> 8.009: 644 read: 1; total=6
> 9.002: 644 read: 1; total=7
> 10.001: 644 read: 1; total=8
> 11.010: 644 read: 1; total=9
> 12.017: 644 read: 1; total=10
> 
> I tested this STC with differnt clocks, but it's important to
> use the same cloack for clock_gettime and timerfd_create.

Yes, that was careless of me.  I now get the same results as you.  I'll have to 
go back to the emacs sources and see what else might be different there.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019