[SERVER-46631] Optimize TicketHolder::waitForTicketUntil() Created: 04/Mar/20  Updated: 29/Oct/23  Resolved: 06/Mar/20

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

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-03-09, Query 2020-03-23
Participants:

 Description   

This function blocks on a semaphore until a timeout is reached. In the case that we are not contending with other threads to acquire the semaphore, this function need not read the clock in order to calculate its deadline. Reading the clock can be expensive, so it would be beneficial to avoid this work in the common case.

This function is worth optimizing, since it's on the hot path for acquiring a global lock, which pretty much all database operations need to do.



 Comments   
Comment by Githook User [ 06/Mar/20 ]

Author:

{'username': 'dstorch', 'name': 'David Storch', 'email': 'david.storch@mongodb.com'}

Message: SERVER-46631 Optimize acquiring a ticket from TicketHolder in the uncontended case
Branch: master
https://github.com/mongodb/mongo/commit/4f1af057ed0434099fe13dbaa50b00589d84bb48

Generated at Thu Feb 08 05:12:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.