On 13-01-26 04:01 AM, Michael Neumann wrote: > So what I would suggest is the following: > > // task > blocking_read(socket, buffer, ...) > // this will register socket with the schedulers event queue (if not > yet done) and block. > // once the scheduler will receive an "data is available" event from > the kernel > // it will unblock the task. > // then the task will do an non-blocking read() on it's own. > > Basically it's the same what libuv does internally on it's own, just > that the responsibility for doing the read's for example is > moved into the task itself, so there is no longer a need for an I/O task > and we gain full control of the asynchronous reads. > > The advantage is: > > * we no longer need messages for I/O. > * more flexibility > * much better memory usage (no need to copy anymore) > * the design is much easier and better to understand, > libraries become so much easier > > Maybe that's just what you want to implement with the scheduler rewrite?
That is what I would like to see in the rewrite, yes. It will require some care in designing the event-loop interface that's called from the rust-library side, but I think it ought to work. Really we should have done this from the beginning, we just (wrongly) deferred attention to AIO library work too long and wound up already having grown a (duplicate) task scheduler that didn't integrate an IO event loop. So now we have to de-duplicate them. -Graydon _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
