IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 23, 2006, 3:05:21 PM (20 years ago)
Author:
eugene
Message:

adding working threads to server/client mode

Location:
trunk/Ohana/src/opihi/pantasks
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/Makefile

    r7938 r7952  
    7474server = \
    7575$(SDIR)/pantasks_server.$(ARCH).o \
     76$(SDIR)/server_threads.$(ARCH).o \
     77$(SDIR)/server_run.$(ARCH).o \
     78$(SDIR)/server_load.$(ARCH).o \
     79$(SDIR)/InputQueue.$(ARCH).o \
    7680$(SDIR)/ListenClients.$(ARCH).o \
    7781$(SDIR)/CheckPassword.$(ARCH).o
  • trunk/Ohana/src/opihi/pantasks/pantasks_server.c

    r7940 r7952  
    1616int main (int argc, char **argv) {
    1717 
    18   pthread_t thread;
     18  pthread_t clientsThread;
     19  pthread_t tasksThread;
     20  pthread_t jobsThread;
     21  pthread_t inputsThread;
     22  pthread_t controllerThread;
    1923  int InitSocket, BindSocket;
    2024  SockAddress Address;
     
    3236 
    3337  gprintInit ();  // each thread needs to init the printing system
     38  InitInputs ();
    3439
    3540  signal (SIGPIPE, gotsignal);
     
    3843  signal (SIGINT, SIG_DFL);
    3944
    40   // startup (&argc, argv);
    41 
    42   /* set up mechanisms for sharing data between the threads */
    43   // init_data_handling ();
     45  startup (&argc, argv);
    4446
    4547  /* start up the background threads here */
    46   pthread_create (&thread, NULL, &ListenClients, NULL);
    47 
    48   // pthread_create (&thread, NULL, &RunScheduler, NULL);
    49   // pthread_create (&thread, NULL, &RunController, NULL);
     48  pthread_create (&clientsThread,    NULL, &ListenClients,         NULL);
     49  pthread_create (&tasksThread,      NULL, &CheckTasksThread,      NULL);
     50  pthread_create (&jobsThread,       NULL, &CheckJobsThread,       NULL);
     51  pthread_create (&controllerThread, NULL, &CheckControllerThread, NULL);
     52  pthread_create (&inputsThread,     NULL, &CheckInputsThread,     NULL);
    5053
    5154  /* in this loop, we listen for incoming connections, validate, and
  • trunk/Ohana/src/opihi/pantasks/server.c

    r7930 r7952  
    44int quit            PROTO((int, char **));
    55int input           PROTO((int, char **));
     6int server_load     PROTO((int, char **));
     7int server_run      PROTO((int, char **));
     8int server_stop     PROTO((int, char **));
    69int cd              PROTO((int, char **));
    710int pwd             PROTO((int, char **));
     
    1417  {"quit",   quit,   "shutdown server"},
    1518  {"input",  input,  "load input file on server"},
     19  {"load",   server_load, "load input file on server"},
     20  {"run",    server_run,  "run scheduler"},
     21  {"stop",   server_stop, "stop scheduler"},
    1622  {"cd",     cd,     "set local directory"},
    1723  {"pwd",    pwd,    "check local directory"},
  • trunk/Ohana/src/opihi/pantasks/status.c

    r7917 r7952  
    99    gprint (GP_LOG, " Scheduler is running\n");
    1010  }
    11   if (CheckControllerStatus ()) {
     11  if (CheckControllerStatus()) {
     12    gprint (GP_LOG, " Controller is running\n");
     13  } else {
     14    gprint (GP_LOG, " Controller is stopped\n");
     15  }
     16  if (CheckTasksGetState()) {
     17    gprint (GP_LOG, " Scheduler is running\n");
     18  } else {
     19    gprint (GP_LOG, " Scheduler is stopped\n");
     20  }
     21  if (CheckControllerGetState()) {
    1222    gprint (GP_LOG, " Controller is running\n");
    1323  } else {
Note: See TracChangeset for help on using the changeset viewer.