[SERVER-49106] Add poll function to the ServiceExecutor API Created: 25/Jun/20 Updated: 29/Oct/23 Resolved: 28/Jul/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Benjamin Caimano (Inactive) | Assignee: | Amirsaman Memaripour |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Service arch 2020-07-13, Service Arch 2020-07-27, Service Arch 2020-08-10 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
If we are on a thread pool, we want to avoid blocking threads while waiting for new data to read. This would imply that a thread somewhere is [e]polling for us, most likely an ASIOReactor. However, if we’re already on a dedicated thread, we want to block our own thread. To solve this contradiction, we want to provide a function Future<void> ServiceExecutor::waitForData(Session*) that polls and then reschedules execution for its future. We should be able to invoke asio::async_read with an asio::null_buffers, thus copying no data until we are safely on the correct thread. |
| Comments |
| Comment by Githook User [ 28/Jul/20 ] |
|
Author: {'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}Message: |
| Comment by Githook User [ 23/Jul/20 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: Revert " This reverts commit a3ed860ba4fbb9a662440c8e9608fef5fa6c8712. |
| Comment by Githook User [ 22/Jul/20 ] |
|
Author: {'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}Message: |