OSDN Git Service

move aio queue allocation from io thread to submitting thread
authorRich Felker <dalias@aerifal.cx>
Tue, 11 Dec 2018 21:29:07 +0000 (16:29 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 11 Dec 2018 21:29:07 +0000 (16:29 -0500)
commit8511511c583cf44ed3aa0bbcaab9168956dce493
tree5f080fdce21283e2e9e0c398e035a23f6e51d30f
parent1a6d6f131bd60ec2a858b34100049f0c042089f2
move aio queue allocation from io thread to submitting thread

since commit c9f415d7ea2dace5bf77f6518b6afc36bb7a5732, it has been
possible that the allocator is application-provided code, which cannot
necessarily run safely on io thread stacks, and which should not be
able to see the existence of io threads, since they are an
implementation detail.

instead of having the io thread request and possibly allocate its
queue (and the map structures leading to it), make the submitting
thread responsible for this, and pass the queue pointer into the io
thread via its args structure. this eliminates the only early error
case in io threads, making it no longer necessary to pass an error
status back to the submitting thread via the args structure.
src/aio/aio.c