Issue 27346: Implement os.readv() / os.writev() in Windows port (original) (raw)

Created on 2016-06-18 09:39 by socketpair, last changed 2022-04-11 14:58 by admin.

Messages (6)
msg268782 - (view) Author: Марк Коренберг (socketpair) * Date: 2016-06-18 09:39
These functions are not implemented natively in Windows, but the Windows API has analogous functions ReadFileScatter and WriteFileGather.
msg268785 - (view) Author: Марк Коренберг (socketpair) * Date: 2016-06-18 09:41
Also do not forget to fix documentation:
msg268788 - (view) Author: Марк Коренберг (socketpair) * Date: 2016-06-18 09:59
however, unlike the POSIX functions, they require the alignment of each buffer on a memory page
msg268799 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-06-18 12:31
ReadFileScatter and WriteFileGather also require a handle for a file that's opened with FILE_FLAG_OVERLAPPED (asynchronous access; the file pointer is not updated) and FILE_FLAG_NO_BUFFERING (buffers must be a multiple of the physical sector size and aligned to the physical sector size). So Python wouldn't be able to use the C runtime's POSIX (low) I/O implementation. ISTM this requires resolving issue 12939, with support for overlapped I/O.
msg388781 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2021-03-15 22:26
The need for asynchronous I/O (i.e. FILE_FLAG_OVERLAPPED) with ReadFileScatter() and WriteFileGather() makes them a poor fit for POSIX os.readv() and os.writev(), since we can't open the file with open() or os.open(). Python's socket module opens sockets in asynchronous mode, but ReadFileScatter() and WriteFileGather() don't support sockets, and there are socket-specific alternatives (e.g. WSASend with multiple buffers). If these Windows API functions are supported at all, I expect it will be in _winapi or _overlapped, and only if needed by the standard library. I'm changing the status of this enhancement request to pending, awaiting feedback from Марк and the core developers.
msg388797 - (view) Author: Марк Коренберг (socketpair) * Date: 2021-03-16 02:16
I'm not interested in Windows platform anymore.
History
Date User Action Args
2022-04-11 14:58:32 admin set status: pending -> opengithub: 71533
2021-03-16 02:28:13 eryksun set status: open -> pending
2021-03-16 02:16:36 socketpair set status: pending -> openmessages: +
2021-03-15 22:26:17 eryksun set status: open -> pendingmessages: + versions: + Python 3.8, Python 3.9, Python 3.10, - Python 3.6
2016-07-26 19:31:02 socketpair set title: Implement os.readv() / os.writev() -> Implement os.readv() / os.writev() in Windows port
2016-06-18 12:32:39 eryksun set components: + Library (Lib), - Extension Modules
2016-06-18 12:31:07 eryksun set nosy: + eryksunmessages: +
2016-06-18 09:59:08 socketpair set messages: +
2016-06-18 09:43:56 martin.panter set nosy: + paul.moore, tim.golden, zach.ware, steve.dowercomponents: + Extension Modules, Windows, - Library (Lib)
2016-06-18 09:41:17 socketpair set messages: +
2016-06-18 09:40:03 socketpair set title: Implement os.readv() / os.readv() -> Implement os.readv() / os.writev()
2016-06-18 09:39:53 socketpair create