Changeset 18752 for branches/eam_branch_20080719/pswarp/src/pswarp.c
- Timestamp:
- Jul 27, 2008, 8:00:23 AM (18 years ago)
- File:
-
- 1 edited
-
branches/eam_branch_20080719/pswarp/src/pswarp.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080719/pswarp/src/pswarp.c
r18748 r18752 18 18 19 19 // create the thread pool with 4 threads, supplying our thread launcher function 20 // XXX need to determine the number of threads from the config data 20 21 psThreadPoolInit (4, &pswarpThreadLauncher); 21 22 22 srand48(0);23 24 for (int i = 0; i < 10; i++) {25 // allocate a job which takes two arguments26 // XXX probably don't need to pre-specify the number of args27 psThreadJob *job = psThreadJobAlloc ("THREAD_TEST", 2);28 29 // construct the arguments for this job30 char *arg1 = NULL;31 char *arg2 = NULL;32 psStringAppend (&arg1, "arg1.%d", i);33 psStringAppend (&arg2, "arg2.%d", i);34 psArrayAdd (job->args, 1, arg1);35 psArrayAdd (job->args, 1, arg2);36 37 psThreadJobAddToQueue (job);38 }39 if (!psThreadPoolWait ()) {40 fprintf (stderr, "error in a threaded job\n");41 exit (1);42 }43 fprintf (stderr, "success for threaded jobs\n");44 exit (0);45 46 23 // model inits are needed in pmSourceIO 47 24 // models defined in psphot/src/models are not available in psastro
Note:
See TracChangeset
for help on using the changeset viewer.
