Since many people believe they need only aio_read and aio_write (and not
something like eio), here are a few words on how I think one should integrate
aio_xxx into libev programs.
the sus aio functions let you specify a signal to be delivered (this is
usually quite slow) on completion, or a callback to be called
(sigev_notify_function).
The ideal way to make use of that in libev programs is to create an ev_async
watcher and do your processing in its callback.
Then you should ste sigev_notify_function to a simple callback that
invokes ev_async_send on that watcher.
The only issue currently is that ev_async watcher processing is
O(#async-watchers), so it doesn't scale to a large number of watchers.
(I haven't found a way to reduce this effectively).
So a better approach would use a single ev_async watcher and a
mutex-locked queue where you queue which requests have been notified, and
unqueue them in the ev_async callback (libev unfortunately can't do that -
a signal/thread safe queue without locking would work wonders for me :)
I think it could be a nice exepriment to try to write a small library
that only offered this and would use overlapped I/O on completion ports
on windows as well, so one could have simple ev_aio_read and ev_aio_write
(maybe fsync) functions.
(An experiment I won't try to execute)
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / [EMAIL PROTECTED]
-=====/_/_//_/\_,_/ /_/\_\
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev