IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2007, 4:26:31 PM (20 years ago)
Author:
eugene
Message:

added module system; added panstarrs user features; panstarrs threaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/pantasks.c

    r9473 r11084  
    1010void program_init (int *argc, char **argv) {
    1111 
     12  pthread_t jobsThread;
     13  pthread_t tasksThread;
     14  pthread_t controllerThread;
     15
    1216  auto_break = TRUE;
    1317
     
    2630  set_str_variable ("RCFILE", opihi_rcfile);
    2731
    28 # ifdef HELPDIR_DEFAULT
    29   set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT));
     32# ifdef DATADIR_DEFAULT
     33  {
     34    char *datadir;
     35    char *helpdir;
     36    char *modules;
     37    datadir = MACRO_NAME(DATADIR_DEFAULT);
     38    /* set_str_variable ("DATADIR", datadir); */
     39    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
     40    sprintf (helpdir, "%s/help", datadir);
     41    set_str_variable ("HELPDIR", helpdir);
     42    free (helpdir);
     43    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
     44    sprintf (modules, "%s/modules", datadir);
     45    set_str_variable ("MODULES:0", modules);
     46    set_int_variable ("MODULES:n", 1);
     47    free (helpdir);
     48  }
    3049# endif
    3150
     
    3352  signal (SIGTSTP, gotsignal);
    3453  signal (SIGTTIN, gotsignal);
     54
     55  /* start up the background threads here */
     56  pthread_create (&tasksThread,      NULL, &CheckTasksThread,      NULL);
     57  pthread_create (&jobsThread,       NULL, &CheckJobsThread,       NULL);
     58  pthread_create (&controllerThread, NULL, &CheckControllerThread, NULL);
    3559  return;
    3660}
     
    6185  exit (status);
    6286}
     87
     88/* pantasks runs three (or four) threads:
     89   - one thread parses commands from the connected clients
     90   - one thread runs the scheduler loop
     91   - one thread may run the controller loop independently
     92   - the main thread runs readline and accepts user input
     93*/
Note: See TracChangeset for help on using the changeset viewer.