Changeset 23530 for trunk/Ohana/src/opihi/pantasks/CheckTasks.c
- Timestamp:
- Mar 25, 2009, 11:56:09 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/CheckTasks.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckTasks.c
r23329 r23530 7 7 int status; 8 8 float time_running, next_timeout, fuzz; 9 // struct timeval now;10 9 11 10 // actual maximum delay is controlled in job_threads.c 12 11 next_timeout = 1.0; 13 12 13 JobTaskLock(); 14 14 /** test all tasks: ready to test? ready to run? **/ 15 15 while ((task = NextTask ()) != NULL) { … … 54 54 /* ready to run? : run task.exec macro */ 55 55 if (task[0].exec != NULL) { 56 // we need to unlock JobTask since JobTaskLock is called inside CommandLock in the client thread 57 JobTaskUnlock(); 58 CommandLock(); 56 59 status = exec_loop (task[0].exec); 60 CommandUnlock(); 61 JobTaskLock(); 57 62 if (!status) { 58 63 continue; 59 64 } 60 65 } 61 62 // gettimeofday (&now, (void *) NULL);63 // fprintf (stderr, "t1: %d %6d - \n", now.tv_sec, now.tv_usec);64 66 65 67 /* check if there are errors with this task */ … … 68 70 } 69 71 70 // gettimeofday (&now, (void *) NULL);71 // fprintf (stderr, "t2: %d %6d - \n", now.tv_sec, now.tv_usec);72 73 72 /* construct job from task */ 74 73 job = CreateJob (task); 75 74 if (DEBUG) fprintf (stderr, "create job: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 76 75 77 // gettimeofday (&now, (void *) NULL); 78 // fprintf (stderr, "t3: %d %6d - \n", now.tv_sec, now.tv_usec); 79 80 /* execute job - XXX add status test */ 81 SubmitJob (job); 82 83 // fprintf (stderr, "nl: %d %6d - ", 84 // task[0].last.tv_sec, task[0].last.tv_usec); 85 86 /* increment job counters */ 87 task[0].Njobs ++; 88 task[0].Npending ++; 89 90 // fprintf (stderr, "%d %6d\n", 91 // task[0].last.tv_sec, task[0].last.tv_usec); 76 /* execute job */ 77 if (!SubmitJob (job)) { 78 DeleteJob (job); 79 continue; 80 } 81 task[0].Njobs ++; // number of jobs successfully submitted 92 82 93 83 /* increment Nrun for inclusive ranges with Nmax */ 94 84 BumpTimeRanges (task[0].ranges, task[0].Nranges); 95 85 } 86 JobTaskUnlock(); 96 87 return (next_timeout); 97 88 }
Note:
See TracChangeset
for help on using the changeset viewer.
