[SERVER-8939] consider making server not use sleepmicros() Created: 11/Mar/13  Updated: 10/Dec/14  Resolved: 06/Oct/14

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Dwight Merriman Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-10362 yielding during read queries waiting ... Closed
Related
related to SERVER-2114 Don't use select timeouts for fast co... Closed
Participants:

 Description   

sleepmicros() is misleading as the resolution can be very low on most operating systems. a quick test on linux yielded the results below. on windows it is even more coarse-grained always taking close to 1ms if the parameter is non-zero.

left is requested micros, right is actual

sleep 0 time: 1
sleep 1 time: 98
sleep 3 time: 71
sleep 7 time: 65
sleep 15 time: 72
sleep 31 time: 88
sleep 63 time: 120
sleep 127 time: 187
sleep 255 time: 314
sleep 511 time: 596
sleep 1023 time: 1131
sleep 2047 time: 2140
sleep 4095 time: 4188



 Comments   
Comment by Juho Mäkinen [ 26/Jan/14 ]

This looks like a duplicate of https://jira.mongodb.org/browse/SERVER-10362 which has been fixed.

Generated at Thu Feb 08 03:18:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.