[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LibEvent binding to Lua? Mix w/ HelperThreads?
- From: Doug Currie <doug.currie@...>
- Date: Tue, 4 Apr 2006 11:09:16 -0400
Tuesday, April 4, 2006, 12:04:40 AM, Adrian Sietsma wrote:
> Anyway, as I see it there are 3 basic actions:
> 1/ Initiate a request
> 2/ Check (poll) the status/results of a request.
> 3/ Wait for a request to be fulfilled.
> 3 requires some sort of sheduler, although that can be based on
> 3a/ Wait for the next outstanding request to be fulfilled.
> Any higher-level interface can be built from these primitives.
Yes. That's essentially what my library implements, except
1/ Initiate a request -- on a library allocated opaque handle
2/ Check (poll) the status/results of ALL pending requests
Of course, 3 can be built with a loop and #2.
3a/ Wait for the next outstanding request to be fulfilled (with timeout)
In my design, #2 and #3a are the same function, different timeouts.
It would be nicest to use these to createa scheduler and APIs that
initiate a request; suspend the coroutine until completion; resume the
coroutine.
Regards,
e
--
Doug Currie
Londonderry, NH