From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10649 invoked by alias); 11 Mar 2013 19:50:07 -0000 Received: (qmail 10625 invoked by uid 22791); 11 Mar 2013 19:50:05 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,FSL_HELO_BARE_IP_2,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_NONE,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SARE_RAND_1,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Mar 2013 19:49:54 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UF8je-0004tK-Vr for cygwin@cygwin.com; Mon, 11 Mar 2013 20:50:14 +0100 Received: from 119.201.52.130 ([119.201.52.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Mar 2013 20:50:14 +0100 Received: from jojelino by 119.201.52.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Mar 2013 20:50:14 +0100 To: cygwin@cygwin.com From: jojelino Subject: Re: deadlock with busy waiting on sigfe Date: Mon, 11 Mar 2013 19:50:00 -0000 Message-ID: References: <20130116014646.GB13175@ednor.casa.cgf.cx> <20130116021414.GA14341@ednor.casa.cgf.cx> <20130120065456.GC17644@ednor.casa.cgf.cx> <20130311143630.GA6498@ednor.casa.cgf.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:22.0) Gecko/20100101 Thunderbird/22.0a1 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2013-03/txt/msg00211.txt.bz2 On 2013-03-12 AM 4:35, jojelino wrote: > I was trying to CTRL+C cygwin python process that is executing some > operation and fell asleep for 60 seconds repeatedly. I'm pretty sure > that the process was sleeping as i tried interrupt it. And some operation includes making connection to localhost tcp server and sending some command to that. so another thread would be mswsock!SockAsyncThread. this case was very rare and i rarely saw the livelock except this time. #! /usr/bin/python from telnetlib import * import re,sys,time,datetime t=Telnet() t.open('127.0.0.1','9051') def burst(inp): for e in inp.split('\n'): prep=e print prep t.write (e+'\n') ds=t.expect([re.compile('\n')]) print ds[2].strip() #login for tor control protocol burstcommand="" burst(burstcommand) if len(sys.argv)>1: f=open(sys.argv[1],'r') good=f.readline().split(',') others=f.readline().split(',') good=filter(lambda x:x not in others,good) exclude=f.readline().split(',') others=filter(lambda x:x not in exclude,others); assert(len(good)>0) assert(len(others)>0) f.close() else: raise Exception("list needed") import random cont=True while cont: for j in range(10): if cont: s=list() if len(others)>1: xx=good[random.randint(0,len(good)-1)] s.append(xx) s.append(others.pop(random.randint(0,len(others)-1))) else: print 'others insufficient' cont=False break if cont==True: #print "extendcircuit 0", ",".join(s) burst("extendcircuit 0 {0}".format(",".join(s))) else: break print "=====================================================" time.sleep(60) t.close() -- Regards. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple