This is OT, but what is the most scalable design for making such a system call in a thread? I am thinking: thread pool with shared queue.
1) each new connection to the server will trigger a series of N fadvise calls. 2) the first few fadvise calls per connection should happen ASAP 3) ability to re-order the fadvise calls if the client makes a subsequent requests. If anyone cares to comment; should probably put this on stack overflow. On Sun, Jun 5, 2011 at 9:50 AM, Hongli Lai <[email protected]> wrote: > On Sun, Jun 5, 2011 at 3:40 PM, Aaron Boxer <[email protected]> wrote: >> Hello! >> >> Is it possible to use libev to have non-blocking access >> to a blocking system call? In my server, I want to call posix_fadvise() >> on a file, and want to receive a callback when the call returns. > > You need to run your system call in a thread, then have the thread > notify the thread running libev through ev_async. This is the approach > that libeio uses. > > -- > Phusion | Ruby & Rails deployment, scaling and tuning solutions > > Web: http://www.phusion.nl/ > E-mail: [email protected] > Chamber of commerce no: 08173483 (The Netherlands) > > _______________________________________________ > libev mailing list > [email protected] > http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev _______________________________________________ libev mailing list [email protected] http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
