ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/pjob/pjob.c
(Generate patch)

Comparing projects/pjob/pjob.c (file contents):
Revision 1.5 by pajs, Wed Jan 25 20:05:52 2006 UTC vs.
Revision 1.6 by pajs, Mon Jan 30 21:46:59 2006 UTC

# Line 27 | Line 27
27   #include <poll.h>
28   #include <sys/types.h>
29   #include <sys/wait.h>
30 + #include <sys/resource.h>
31  
32   #define DEFNUMTHREAD 10
33   #define DEFTIMEOUT 60
# Line 331 | Line 332 | int main(int argc, char **argv){
332          GError *pp_err = NULL, *err = NULL;
333          gint x;
334  
335 +        struct rlimit rlp;
336 +
337          GOptionContext *optcontext;
338  
339          optcontext = g_option_context_new(" - parallel job executer");
# Line 360 | Line 363 | int main(int argc, char **argv){
363          }else{
364                  g_printerr("Threading not supported\n");
365          }
366 +
367 +        /* Up the number of FD's to the "hard" limit.
368 +         * This is mainly to get around the very small default
369 +         * solaris has, or 256
370 +         */
371 +        getrlimit(RLIMIT_NOFILE, &rlp);
372 +        rlp.rlim_cur = rlp.rlim_max;
373 +        setrlimit(RLIMIT_NOFILE, &rlp);
374          
375          if(verbose) g_printerr("Creating a threadpool %d in size\n", numthreads);
376          procpool = g_thread_pool_new(process_child, NULL, numthreads, FALSE, &pp_err);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines