Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Async File I/O

Moderators: larsivi kris

Posted: 05/24/09 19:05:52

Hi, did anybody ever tried to get async file i/o working with tango? Is it even possible right now? I tried to use the Selector interface but it stops with 'The conduit cannot be used with this Selector'. See the fairly simple approach I used:

---

File file = new File("input.txt");
Selector selector = new Selector();

selector.open(2, 3);
selector.register(file, Event.Read);

---

Any ideas on how to progress from this point?

Author Message

Posted: 05/24/09 19:12:19

we expect to have full async I/O support in the near future

Posted: 05/25/09 18:40:46

Could I help in any way?

Posted: 05/25/09 20:07:52

Thanks for the offer, Tomni ... if you have prior experience with either epoll or kqueue, and have access to IRC, then yes :)

Posted: 03/31/11 15:48:50

There is hardly a way to make files work with epoll... async i/o is something different than non-blocking i/o

File i/o is usually always non blocking. Non-blocking here means that data is ready to read/write. Local files data is _always_ ready to be read or written, the operation itself still will take time.

What you want is async i/o. The call to an asnyc i/o operation will make that function return immidiately but the operation itself will be completed in the background. In Linux, those are the aio_* functions (aio_read/aio_write and others).

Now, I wonder, how should we implement async i/o in tango?

--Marenz