demux_evtport_demuxer.hpp

00001 #line 406 "./lpsrc/flx_demux.pak"
00002 #ifndef __EVTPORT_DEMUXER__
00003 #define __EVTPORT_DEMUXER__
00004 
00005 // driver for solaris 10 event port notifications
00006 
00007 #include "demux_posix_demuxer.hpp"
00008 
00009 namespace flx { namespace demux {
00010 
00011 // Event ports are oneshot by default (I don't know if you can change that).
00012 // Events are tracked only by fd and not fd*event, so you cannot add
00013 // separate wakeups for read and write with the same fd and hope for it to
00014 // work as the later one will overwrite the earlier, fodder for race
00015 // conditions. This impl satisfies 1-1 wakeup to request ratio.
00016 
00017 // I don't know if evtports can be waited upon by other evtports
00018 
00019 // OBS.
00020 // after removing the threads from the demuxers/event sources
00021 // how are the two half demuxers supposed to work? They used to
00022 // have three threads and now they have one. How can two waits be
00023 // done in one thread? I could add one half_demuxer's evtport to
00024 // the other's and wait on that. Would that work? Otherwise I'll
00025 // have to start a thread, which screws things up a bit. Could do
00026 // that and communicate back to single thread via a waitable queue.
00027 // could have three half-demuxers, add them both to third and call
00028 // their wait functions depending on the outer's wait result.
00029 
00030 class DEMUX_EXTERN evtport_demuxer : public posix_demuxer {
00031     int     evtport;
00032 
00033   // I think evtports only track socket the socket and not
00034   // socket*operation, so there's only one remove
00035   void remove_wakeup(int s);
00036 
00037     virtual void  get_evts(bool poll);
00038 public:
00039   evtport_demuxer();
00040   virtual ~evtport_demuxer();
00041 
00042   virtual int   add_socket_wakeup(socket_wakeup* sv, int flags);
00043 };
00044 
00045 }} // namespace demux, flx
00046 #endif
00047 

Generated on Mon Dec 11 17:13:32 2006 for Felix by  doxygen 1.5.1