Changeset 8548 for trunk/Ohana/src/opihi/pantasks/server_threads.c
- Timestamp:
- Aug 23, 2006, 5:31:41 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/server_threads.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/server_threads.c
r7960 r8548 13 13 } 14 14 15 /* the threaded version of pantasks does not worry about limiting the 16 time spent in one of the test loops -- comms with the client are 17 in a separate thread anyway... 18 */ 19 20 int TestElapsedCheck () { 21 return (FALSE); 22 } 23 15 24 /** things related to CheckTasks **/ 16 25 … … 24 33 } 25 34 26 void CheckTasksThread (void *data) {35 void *CheckTasksThread (void *data) { 27 36 28 37 gprintInit (); // each thread needs to init the printing system … … 31 40 // check for thread suspend 32 41 if (!CheckTasksRun) { 33 usleep ( 500000);42 usleep (100000); // idle if thread action is suspended 34 43 continue; 35 44 } … … 38 47 SerialThreadLock (); 39 48 CheckTasks (); 49 CheckJobs (); 40 50 SerialThreadUnlock (); 41 51 fprintf (stderr, "T"); 42 usleep ( 250000);52 usleep (10000); // allow other threads a chance to run 43 53 } 44 54 } 45 55 56 # if 0 57 // XXX need to harvest jobs on the same thread as they were 58 // spawned. for the moment, put CheckTasks and CheckJobs in 59 // a single thread. 46 60 /** things related to CheckJobs **/ 47 61 … … 55 69 } 56 70 57 void CheckJobsThread (void *data) {71 void *CheckJobsThread (void *data) { 58 72 59 73 gprintInit (); // each thread needs to init the printing system … … 62 76 // check for thread suspend 63 77 if (!CheckJobsRun) { 64 usleep ( 500000);78 usleep (100000); // idle if thread action is suspended 65 79 continue; 66 80 } … … 71 85 SerialThreadUnlock (); 72 86 fprintf (stderr, "J"); 73 usleep ( 250000);87 usleep (10000); // allow other threads a chance to run 74 88 } 75 89 } 90 # endif 76 91 77 92 /** things related to CheckController **/ … … 86 101 } 87 102 88 void CheckControllerThread (void *data) {103 void *CheckControllerThread (void *data) { 89 104 90 105 gprintInit (); // each thread needs to init the printing system … … 93 108 // check for thread suspend 94 109 if (!CheckControllerRun) { 95 usleep ( 500000);110 usleep (100000); // idle if thread action is suspended 96 111 continue; 97 112 } … … 103 118 SerialThreadUnlock (); 104 119 fprintf (stderr, "C"); 105 usleep ( 250000);120 usleep (10000); // allow other threads a chance to run 106 121 } 107 122 } … … 118 133 } 119 134 120 void CheckInputsThread (void *data) {135 void *CheckInputsThread (void *data) { 121 136 122 137 gprintInit (); // each thread needs to init the printing system … … 125 140 // check for thread suspend 126 141 if (!CheckInputsRun) { 127 usleep ( 500000);142 usleep (100000); // idle if thread action is suspended 128 143 continue; 129 144 } … … 134 149 SerialThreadUnlock (); 135 150 fprintf (stderr, "I"); 136 usleep ( 250000);151 usleep (10000); // allow other threads a chance to run 137 152 } 138 153 }
Note:
See TracChangeset
for help on using the changeset viewer.
