Nox uses cooperative threading from a thread pool. Each event is executed within one of the threads in the pool. If one of the handlers for that thread blocks on a synchronous operation, another event (provided one is ready) will be dispatched in a different thread context.

I'm probably missing something basic, but if events are processed sequentially and each event is sent sequentially to each of its handlers, then where does threading play a role?


On Tue, Mar 9, 2010 at 9:18 PM, Martin Casado <[email protected] <mailto:[email protected]>> wrote:

    Events are processed sequentially until an event blocks on an IO
    operation or stops in which case another event may enter the system.

        NOX is described as supporting an asynchronous programming
        model. I'm trying to understand what this means by considering
        the following scenarios:

        Multiple components are registered to handle a single event. I
        understand that this event will be passed sequentially to each
        component registered to handle it in the order specified in
        nox.ml <http://nox.ml> <http://nox.ml>. The subsequent handler
        is only called if the previous one returns CONTINUE.
        Alternatively, processes could be forked to call all of this
        event's handlers simultaneously. However, this latter option
        is not supported, correct?


        Two events are queued, first event A and then B. Event A gets
        dispatched to its first handler. When is Event B dispatched?
        Does NOX await completion of Event A's processing?

        ------------------------------------------------------------------------

        _______________________________________________
        nox-dev mailing list
        [email protected] <mailto:[email protected]>
        http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org




_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to