home *** CD-ROM | disk | FTP | other *** search
- //
- // Modification History:
- //
- // 12-Jan-90 JEF
- // Add support for processor affinity on Sequent Symmetry.
- //
- // 04-Jan-90 JEF
- // Add stacksize, get_stacksize(), and get_numprocessors().
- // Move most of constructor into run() and invoke run() from main
- // function after constructor returns. This allows us to access the
- // above new functions from elsewhere in the program.
- //
-
- class Main {
- int numprocessors; // # scheduling processors
- int nummainthreads; // # threads in Main::main()
- int mainstacksizes; // size of stack for each of the
- // nummainthreads threads
- int stacksize; // size of stack for all other threads
- int quantum; // scheduling quantum
- #ifdef i386
- int affinity; // if non-zero, processor affinity will
- // be attempted via tmp_affinity
- #endif i386
- #ifdef PROFILE
- int numprofilers;
- #endif
- int argc; // argc from main
- char **argv; // argv from main
- char **envp; // envp from main
- public:
- Main(int ac, char **av, char **ep);
- ~Main();
- int preallocthreads(int cnt, int sz = DEFSTACKSIZ);
- void run ();
- int init(); // user provides
- int main(); // init, main, done...
- int done(); //
- int get_numprocessors ()
- { return numprocessors; }
- int get_nummainthreads ()
- { return nummainthreads; }
- int get_mainstacksizes ()
- { return mainstacksizes; }
- int get_stacksize ()
- { return stacksize; }
- #ifdef i386
- int get_affinity ()
- { return affinity; }
- #endif i386
- };
-
-
- #define MAINNAME "MAIN"
-
-
-
-