Message354343
> Background: Doing I/O to files on disk has a hugely bimodal latency. If the I/O happens to be in or going to cache (either user-space cache, like in io.BufferedIOBase, or the OS's page cache), then the operation returns instantly (~1 µs) without blocking. OTOH if the I/O isn't cached (for reads) or cacheable (for writes), then the operation may block for 10 ms or more.
On Linux 4.14 and newer, Python 3.8 now provides os.preadv(os.RWF_NOWAIT):
"Do not wait for data which is not immediately available. If this flag is specified, the system call will return instantly if it would have to read data from the backing storage or wait for a lock. If some data was successfully read, it will return the number of bytes read. If no bytes were read, it will return -1 and set errno to errno.EAGAIN."
At least on recent Linux, it became possible to write a different code path for uncached data. |
|
Date |
User |
Action |
Args |
2019-10-10 08:34:56 | vstinner | set | recipients:
+ vstinner, pitrou, giampaolo.rodola, benjamin.peterson, stutzbach, njs, martin.panter, YoSTEALTH, xgdomingo |
2019-10-10 08:34:56 | vstinner | set | messageid: <1570696496.93.0.216127922464.issue32561@roundup.psfhosted.org> |
2019-10-10 08:34:56 | vstinner | link | issue32561 messages |
2019-10-10 08:34:56 | vstinner | create | |
|