IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 27, 2008, 8:00:23 AM (18 years ago)
Author:
eugene
Message:

threaded and unthreaded equivalent versions now compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080719/pswarp/src/pswarp.c

    r18748 r18752  
    1818
    1919    // 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
    2021    psThreadPoolInit (4, &pswarpThreadLauncher);
    2122   
    22     srand48(0);
    23 
    24     for (int i = 0; i < 10; i++) {
    25         // allocate a job which takes two arguments
    26         // XXX probably don't need to pre-specify the number of args
    27         psThreadJob *job = psThreadJobAlloc ("THREAD_TEST", 2);
    28 
    29         // construct the arguments for this job
    30         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 
    4623    // model inits are needed in pmSourceIO
    4724    // models defined in psphot/src/models are not available in psastro
Note: See TracChangeset for help on using the changeset viewer.