faio_drv.hpp

00001 #line 723 "./lpsrc/flx_faio.pak"
00002 #ifndef __FLXDRV__
00003 #define __FLXDRV__
00004 #include <flx_faio_config.hpp>
00005 
00006 #include "pthread_sleep_queue.hpp"
00007 #include "pthread_work_fifo.hpp"
00008 #include "demux_timer_queue.hpp"
00009 #include "demux_demuxer.hpp"
00010 
00011 namespace flx { namespace faio {
00012 // vestigal driver class is all that remains of the embedded driver from
00013 // which faio came. all it is now is a pointer to a queue.
00014 // watch this space.
00015 class FAIO_EXTERN flx_drv {
00016     flx::pthread::sleep_queue_t&    ready_queue;
00017     flx::pthread::worker_fifo     work_fifo;
00018 public:
00019     flx_drv(
00020       flx::pthread::sleep_queue_t& q,
00021       int qbound, int nthreads
00022     );
00023     virtual ~flx_drv();
00024 
00025     void sched(void* f);
00026 
00027     flx::pthread::worker_fifo* get_worker_fifo() { return &work_fifo; }
00028     virtual demux::timer_queue* get_sleepers() = 0;
00029 };
00030 
00031 // this becomes socket thread wakeup. um.
00032 class FAIO_EXTERN thread_wakeup {
00033 public:
00034     void wake() { drv->sched(f); }
00035 
00036     void*           f;              // thread to be woken
00037     flx_drv*        drv;            // in which driver
00038 };
00039 
00040 // to be called inside every start_async_op
00041 // note: the windows version often needs the demuxer, but the posix one
00042 // doesn't. I forget why.
00043 #define RECORD_THREAD_INFO(w) (w).f=f;\
00044                               (w).drv=drv;
00045 
00046 }}
00047 #endif              //__FLXDRV__
00048 
00049 

Generated on Mon Dec 11 18:08:29 2006 for Felix by  doxygen 1.5.1