X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FScheduler.cc;h=f7509bcb28f4999f1a4b7dd5ff0de250a4048751;hb=2d51a34f79dd18b23c54172444b2cc7433b8f5f0;hp=62a5dfecf55bdb2ac3f8a2ef315786dee5ff4c47;hpb=ac6a813d9d99f7add4e13aff7a4bcd314d5604a6;p=senf.git diff --git a/Scheduler/Scheduler.cc b/Scheduler/Scheduler.cc index 62a5dfe..f7509bc 100644 --- a/Scheduler/Scheduler.cc +++ b/Scheduler/Scheduler.cc @@ -20,7 +20,20 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// TODO: Implement signal handling +/** \file + \brief Scheduler non-inline non-template implementation + + \idea Implement signal handling (See source for more discussion + about this) + + \idea Multithreading support: To support multithreading, the + static member Scheduler::instance() must return a thread-local + value (that is Scheduler::instance() must allocate one Scheduler + instance per thread). Another possibility would be to distribute + the async load unto several threads (one scheduler for multiple + threads) + */ + // Here a basic concept of how to add signal support to the scheduler: // // Every signal to be reported by the scheduler will be asigned a @@ -52,17 +65,12 @@ // You should use sigaction to register the signal handlers and define // a sa_mask so all Scheduler-registered signals are automatically // *blocked* whenever one of the signals is called (including the -// called signal!). This ensures, that no two signals can be delivered -// on top of each other. And of course any signal registered with the -// scheduler must be blocked as soon as it is registered with the -// scheduler. - -// TODO: Multithreading support -// To support multithreading, the static member Scheduler::instance() -// must return a thread-local value (that is Scheduler::instance() -// must allocate one Scheduler instance per thread) - -// Definition of non-inline non-template functions +// called signal!) (This also means, we will have to re-register all +// signals if we change the registration of some signal since the +// sa_mask changes). This ensures, that no two signals can be +// delivered on top of each other. And of course any signal registered +// with the scheduler must be blocked as soon as it is registered with +// the scheduler. #include "Scheduler.hh" //#include "Scheduler.ih" @@ -204,6 +212,10 @@ prefix_ void senf::Scheduler::process() if (spec.cb_hup) spec.cb_hup(EV_HUP); else if (ev.events & EPOLLERR) { + /** \fixme This is stupid, if cb_write and cb_read are + the same. The same below. We really have to + exactly define sane semantics of what to do on + EPOLLHUP and EPOLLERR. */ if (spec.cb_write) spec.cb_write(EV_HUP); if (spec.cb_read) spec.cb_read(EV_HUP); }