[Xorp-hackers] Multithreading routing process

Atanu Ghosh atanu@ICSI.Berkeley.EDU
Fri, 12 Nov 2004 23:02:06 -0800


The eventloop can wait for timer or file descriptor events. One solution
is to have the non XORP threads write their messages (FIFO) on a pipe or
socket. In the XORP thread use the EventLoop::add_selector to register
interest in the pipe/socket. Therefore whenever a non XORP thread writes
a message the XORP thread will receive a notification immediately.

  Atanu.

>>>>> "Rafael" == Rafael Paoliello Guimaraes <rafael.guimaraes@ac.upc.es> writes:

    Rafael> Hello, I am migrating a multithreading routing process
    Rafael> implementation to XORP and, since XORP does not support
    Rafael> multithreading, I was thinking about building a
    Rafael> communication thread that receives requests from every
    Rafael> thread of the routing process and converts this to XRL
    Rafael> calls. In order to do this, I though about a FIFO that could
    Rafael> store requests from every thread and the communication
    Rafael> process simply processes the requests one by one.

    Rafael> Ok, this seems to solve my problem (or not?)... However, in
    Rafael> order to process these requests, the only thing the
    Rafael> communication thread does is to run the eventloop with a
    Rafael> periodic timer that calls a function to process any request
    Rafael> that is present in the FIFO. This causes a little delay in
    Rafael> the processing of requests (such as sending a control
    Rafael> packet, for example). If use a small period for this event,
    Rafael> this should not be a problem, however I was thinking if
    Rafael> there is any way to process the requests as soon as they are
    Rafael> available. Can I, for example, schedule an one-off event
    Rafael> (with a time-out equal to zero or close to zero) whenever a
    Rafael> new request is available in the FIFO? This would be done
    Rafael> concurrently to the eventloop execution. Would this work? Or
    Rafael> should I forget this and keep on my original solution? Or
    Rafael> even the original solution is not good?

    Rafael> Cheers,

    Rafael> --

    Rafael> =========================================== Rafael Paoliello
    Rafael> Guimaraes PhD Student - Computer Networking Group Department
    Rafael> of Computer Architecture (DAC) Polytechnic University of
    Rafael> Catalonia (UPC) Phone: +34-934017187 Fax: +34-934017055 URL:
    Rafael> http://people.ac.upc.es/rpaoliel
    Rafael> ===========================================
    Rafael> _______________________________________________ Xorp-hackers
    Rafael> mailing list Xorp-hackers@icir.org
    Rafael> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers