libuv/libev/libevent in Async

53 views
Skip to first unread message

Malcolm Matalka

unread,
Jun 11, 2014, 4:30:09 AM6/11/14
to ocaml...@googlegroups.com
I'm pretty sure that this discussion has come up before but I don't
recall the result, and it was over a year ago so perhaps things have
changed. I haven't poked around the code at all so perhaps this
question is obsolete as well.

Is there any value to moving the core of Async to one of these
libraries? One possible value is portability (libuv works on windows,
as far as I know). Another is perhaps performance (but I don't know
if/where Async has bottlenecks). And pushing C code out of Async to a
commonly used and tested third party library.

Thanks,
/M

Yaron Minsky

unread,
Jun 11, 2014, 5:55:10 AM6/11/14
to ocaml...@googlegroups.com
Sweeks or Jeremie can probably better answer this, but Async has a
pluggable core already for the multiplexing, and supports both epoll
and select, choosable at runtime. epoll on Linux is quite efficient,
so I don't think there's a performance win there for doing to one of
the other libraries, but there is surely a portability win. We've
thought about libuv (specifically for Windows support), and I think
that would be lovely, but getting all the kinks worked out for Windows
on Async will require a lot of tweaking and testing, and so would
really require someone to volunteer some real time to the project.
It's not something we currently have plans to do internally.

y
> --
> You received this message because you are subscribed to the Google Groups "ocaml-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Malcolm Matalka

unread,
Jun 11, 2014, 7:29:33 AM6/11/14
to ocaml...@googlegroups.com
Great, thanks for answer.

Is there any list somewhere of cool things the Core team would be
willing to accept PR's on but doesn't have time to do on their own?
Just open issues on github perhaps?

Anil Madhavapeddy

unread,
Jun 11, 2014, 7:56:55 AM6/11/14
to ocaml...@googlegroups.com
In this particular case, it would be really interesting to see a
Ctypes binding to libuv, and have an alternative to Async_unix. This
would really help the process of getting Async to a portable core (in
the same style as Lwt and Lwt_unix)

-anil

Nicolas Trangez

unread,
Jun 11, 2014, 8:28:59 AM6/11/14
to ocaml...@googlegroups.com
On Wed, 2014-06-11 at 12:56 +0100, Anil Madhavapeddy wrote:
> In this particular case, it would be really interesting to see a
> Ctypes binding to libuv,

I worked on that some time ago, might have the source around somewhere
on an old machine. Problem I faced was (back then) being unable to tag a
C call to unlock the runtime lock. AFAIK some recent changes to ctypes
add support for this.

Anyway, it was the first time I used ctypes and creating the bindings
was fairly trivial.

Nicolas

Anil Madhavapeddy

unread,
Jun 11, 2014, 10:14:50 AM6/11/14
to ocaml...@googlegroups.com, Jeremy Yallop
On 11 Jun 2014, at 13:28, Nicolas Trangez <nic...@incubaid.com> wrote:

> On Wed, 2014-06-11 at 12:56 +0100, Anil Madhavapeddy wrote:
>> In this particular case, it would be really interesting to see a
>> Ctypes binding to libuv,
>
> I worked on that some time ago, might have the source around somewhere
> on an old machine. Problem I faced was (back then) being unable to tag a
> C call to unlock the runtime lock. AFAIK some recent changes to ctypes
> add support for this.
> Anyway, it was the first time I used ctypes and creating the bindings
> was fairly trivial.

Great! Yes, Ctypes 0.3 with stub generation also generally improves the
state of play with interacting with macros as well.

cheers,
Anil
> To unsubscribe from this group and stop receiving emails from it, send an email toocaml-core...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages