[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55940] pause() takes too long if you call it
From: |
Andrew Janke |
Subject: |
[Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch |
Date: |
Tue, 19 Mar 2019 18:15:20 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36 |
Follow-up Comment #23, bug #55940 (project octave):
Thanks!
Minor bug in delay.cpp:
else if (option = 2)
That should be "option == 2", otherwise the else case (for direct call of
nanosleep) will never get hit.
I've added it to my test repo and modified the output so it only reports
too-long pauses, to make it easier to copy-and-paste output here. A simple "."
indicates a sleep that took less than 2x as long as requested.
https://github.com/apjanke/test-nanosleep-for-octave/blob/1fa1269bcdad7f4d88cdee1b0037b34f6be526ca/src-octfiles/delay.cpp
I've compiled it and run it under Octave 5.1.0. (Octave default is not
building for me right now.)
Results:
octave:1> delay
Using nanosleep (&delay_timespec, &rem);
....................................................................................................
octave:2> delay(1)
Using octave::sleep (0.200000, true)
Step 0: elapsed = 16.175480
Step 1: elapsed = 20.200037
Step 2: elapsed = 20.200055
Step 3: elapsed = 13.168963
[...]
octave:1> delay(2)
Using octave::sleep (0.200000, false)
....................................................................................................
octave:2>
Or:
octave:1> delay(1)
Using octave::sleep (0.200000, true)
....................................................................................................
octave:2> delay(1)
Using octave::sleep (0.200000, true)
..................................
Step 34: elapsed = 9.620640
Step 35: elapsed = 9.745313
Step 36: elapsed = 1.790912
Step 37: elapsed = 10.799203
Step 38: elapsed = 2.362160
Step 39: elapsed = 2.889009
Step 40: elapsed = 3.791923
Step 41: elapsed = 1.356964
Step 42: elapsed = 18.020698
Aborting because it's taking too darn long.
octave:3>
For a bit, I thought that the `octave::sleep (x, false)` case didn't cause
problems, but then I ran this:
octave:1> delay(2)
Using octave::sleep (0.200000, false)
....................................................................................................
octave:2> delay(2)
Using octave::sleep (0.200000, false)
......................................
Step 38: elapsed = 9.160260
Step 39: elapsed = 11.657525
Step 40: elapsed = 20.216943
Step 41: elapsed = 20.581857
Aborting because it's taking too darn long.
octave:3> delay(2)
Using octave::sleep (0.200000, false)
Step 0: elapsed = 14.097041
Step 1: elapsed = 12.041813
Step 2: elapsed = 8.248526
Step 3: elapsed = 19.842456
Step 4: elapsed = 17.350757
Aborting because it's taking too darn long.
octave:4>
The direct nanosleep call causes problems, too!
octave:1> delay
Using nanosleep (&delay_timespec, &rem);
....................................................................................................
octave:2> delay
Using nanosleep (&delay_timespec, &rem);
............................
Step 28: elapsed = 8.850037
Step 29: elapsed = 10.200040
Step 30: elapsed = 10.200059
Step 31: elapsed = 10.200043
Step 32: elapsed = 10.200044
Step 33: elapsed = 10.200041
Aborting because it's taking too darn long.
octave:3> delay
Using nanosleep (&delay_timespec, &rem);
Step 0: elapsed = 8.751405
Step 1: elapsed = 1.168990
Step 2: elapsed = 10.200013
.
Step 4: elapsed = 10.200064
Step 5: elapsed = 10.200065
Step 6: elapsed = 10.200068
Step 7: elapsed = 10.200046
Aborting because it's taking too darn long.
octave:4>
WTF?
So, to me, that doesn't sound like it's a problem in the pause() logic, but
something else.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55940>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, (continued)
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Rik, 2019/03/18
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Mike Miller, 2019/03/18
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/18
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/18
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/18
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Mike Miller, 2019/03/18
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Rik, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Rik, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch,
Andrew Janke <=
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Dmitri A. Sergatskov, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Rik, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Dmitri A. Sergatskov, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Rik, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19
- [Octave-bug-tracker] [bug #55940] pause() takes too long if you call it a bunch, Andrew Janke, 2019/03/19