std.asio?

Martin Drasar drasar at ics.muni.cz
Tue Mar 12 03:07:22 PDT 2013


On 11.3.2013 17:57, Robert wrote:
> On Mon, 2013-03-11 at 17:06 +0100, Martin Drasar wrote:
> 
> I had plans to implement something like this, but at the moment I am
> stuck with other important things. I absolutely agree that something
> like boost::asio::io_service should be part of the standard library, so
> the situation we have in C++ where every library implements its own
> event queue could be avoided. (E.g. the only really working way to use
> Qt and boost::asio together is by using multiple threads) I would love
> to avoid this in D. 
> 
> Ideally we would have asynchronous primitives and a synchronous
> interface compatible to regular streams like the upcoming std.stream
> based on fibers and an event queue. This way also higher level libraries
> building on std.stream like a db abstraction library would automatically
> offer asynchronous operation by simply replacing the used stream with an
> asynchronous fiber based one.

Yup, I would like something like that as well.

> Just in a nutshell what I would try to implement, the moment I get to
> this item on my todo list. Although I would contact Soenke first, as he
> already has a lot of experience with fiber based IO.

I hope he will chime in and says how the things are going. In the last
concurrency post on the forum he said that the concurrency should be
ready this or next month.

> Regarding your problems with vibe, what is your particular problem with
> threads? Have you asked about your problems on
> http://news.rejectedsoftware.com/groups/rejectedsoftware.vibed/ ?
> Maybe they are easily solved? I don't use vibe multi-threaded currently,
> but if it does not work now, it seems that it is worked on. Also Soenke
> is usually glad about pull requests ;-)

It was related to blocking operations like readln stopping the event
loop. See
http://news.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/693/.
No real solution was found as this requires either the fiber support in
std.concurrency or std.concurrency support in vibe.d.

Martin


More information about the Digitalmars-d mailing list