Listing 2: Task-specific subclass


class MyKproc : AIXkproc
{
     private:
          void processWork();
};

MyKproc::processWork()
{
     while ( okToContinue() )
      {
      // do something
      }
}

void run_kproc()
{
MyKproc *worker = new MyKproc("myWorker"); // kernel proc created here
worker->start();                             // execution actually starts here

// Do some other stuff here (if you want...)

delete worker;                             // stop the kernel process
}