RE: Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
The latest snapshot also appears to fix one of the two rsync problems I was experiencing. Problem 1: rsync -av /foo/ /bar/ always hangs at the end of copying files when /bar doesn't exist - fixed Problem 2: rsync -av /foo/ /bar/ always hangs at the end of copying files when /bar already has files from /foo in it - not fixed Thanks! Luke -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
Just thought that I would report that the 1108 snapshot also solved a similar problem with privoxy using 100% of CPU (also apparently on select, which is basically where that program spins all the time) occasionally under high load. I wanted to test for a few days to make sure it was gone. Thanks for the fix! Doug Knisely -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
Yeah,it seems all ok! >On Fri, Nov 07, 2003 at 01:24:29PM -0500, Christopher Faylor wrote: >>On Fri, Nov 07, 2003 at 10:44:20AM -0500, Joe Buehler wrote: >>>zhouxin wrote: If the udp worker's count greater than 18,some thread's select() hang and process take 100 cpu: >>> >>>Interestingly, there is a static pool of 18 threads internally before >>>switching to dynamically created threads. So there may be some problem >>>related to the dynamically allocated threads code. >> >>Hmm. Interesting observation. I took a stab at fixing a couple of >>obvious problems in the thread overflow code. It seems like it might >>have solved the problem. >> >>There will be a new snapshot available in an hour or so at: >> >>http://cygwin.com/snapshots/ >> >>Thanks for the test case, btw. > >So... did the snapshot fix the problem? > >cf > >-- >Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple >Problem reports: http://cygwin.com/problems.html >Documentation: http://cygwin.com/docs.html >FAQ: http://cygwin.com/faq/ > > >. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
On Fri, Nov 07, 2003 at 01:24:29PM -0500, Christopher Faylor wrote: >On Fri, Nov 07, 2003 at 10:44:20AM -0500, Joe Buehler wrote: >>zhouxin wrote: >>>If the udp worker's count greater than 18,some thread's select() hang >>>and process take 100% cpu: >> >>Interestingly, there is a static pool of 18 threads internally before >>switching to dynamically created threads. So there may be some problem >>related to the dynamically allocated threads code. > >Hmm. Interesting observation. I took a stab at fixing a couple of >obvious problems in the thread overflow code. It seems like it might >have solved the problem. > >There will be a new snapshot available in an hour or so at: > >http://cygwin.com/snapshots/ > >Thanks for the test case, btw. So... did the snapshot fix the problem? cf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
On Fri, Nov 07, 2003 at 10:44:20AM -0500, Joe Buehler wrote: >zhouxin wrote: >>If the udp worker's count greater than 18,some thread's select() hang >>and process take 100% cpu: > >Interestingly, there is a static pool of 18 threads internally before >switching to dynamically created threads. So there may be some problem >related to the dynamically allocated threads code. Hmm. Interesting observation. I took a stab at fixing a couple of obvious problems in the thread overflow code. It seems like it might have solved the problem. There will be a new snapshot available in an hour or so at: http://cygwin.com/snapshots/ Thanks for the test case, btw. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
zhouxin wrote: > If the udp worker's count greater than 18,some thread's select() hang and process > take 100% cpu: My vague recollection is that Cygwin allocates threads to handle select(). Interestingly, there is a static pool of 18 threads internally before switching to dynamically created threads. So there may be some problem related to the dynamically allocated threads code. -- Joe Buehler -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Process hang(100% CPU Usage) when concurrent calling select(),cygwin1.5.5-1 WinXP/Win2000
hi,all I have reported this problem a week ago.I belive that the test_select.c(see below) is correct.The usage of select() is classical. This testing program initialize a number of threads, each thread create a socket and send UDP packet to UDP server,then wait response by calling select().If select() return 1, call recvfrom() read the response,else if select() timeout goto next loop... If the udp worker's count greater than 18,some thread's select() hang and process take 100% cpu: $uname -a CYGWIN_NT-5.1 zipxing 1.5.5(0.94/3/2) 2003-09-20 16:31 i686 unknown $gcc -o tsel test_select.c $./tsel 15 127.0.0.1 7 --create 15 threads communicate with UDP echo service,no problem $./tsel 20 127.0.0.1 7 --create 20 threads communicate with UDP echo service,100% CPU! I make test_select.c on solaris9 and linux,it seems all ok. Specially, the testing program work fine use cygwin1.dll 1.3.22! Thanks. = test_select.c = #include #include #include #include #include #include #include #include #include //Select timeout... int timeout = 5; //Thread count... int tcount = 20; struct sockaddr_in servaddr; //Thread function... void * udpworker(void *ptr) { int sockfd = 0; int tid; char buf[256]; tid = (int)ptr; if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0){ printf("cannot open socket for udp packet!\n"); exit(1); } while(1){ struct timevaltv; fd_setrfds; //Send request to UDP server... sendto(sockfd, "echo", 4, 0, (struct sockaddr *)&servaddr, sizeof(servaddr)); //Wait UDP server response... FD_ZERO(&rfds); FD_SET(sockfd, &rfds); tv.tv_sec = timeout; tv.tv_usec = 0; if(select(sockfd + 1, &rfds, NULL, NULL, &tv) == 1) { recvfrom(sockfd, buf, sizeof(buf), 0, NULL, NULL); printf("thread.%d recive a response...%s\n", tid, buf); } else { printf("thread.%d recvfrom timeout?...\n", tid); } sleep(10); } } //Initial udp client thread pool... void thread_pool_init() { int i; pthread_t thrid; for(i=0; i \n"); exit(0); } tcount = atoi(argv[1]); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(atoi(argv[3])); inet_aton(argv[2], &servaddr.sin_addr); thread_pool_init(); while(1) sleep(1000); } = -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/