delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/03/11/15:50:22

X-Recipient: archive-cygwin AT delorie DOT com
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
To: cygwin AT cygwin DOT com
From: jojelino <jojelino AT gmail DOT com>
Subject: Re: deadlock with busy waiting on sigfe
Date: Tue, 12 Mar 2013 04:49:44 +0900
Lines: 59
Message-ID: <khlcgj$efi$1@ger.gmane.org>
References: <kd2d69$lam$1 AT ger DOT gmane DOT org> <20130116014646 DOT GB13175 AT ednor DOT casa DOT cgf DOT cx> <20130116021414 DOT GA14341 AT ednor DOT casa DOT cgf DOT cx> <kdfuvh$a93$1 AT ger DOT gmane DOT org> <20130120065456 DOT GC17644 AT ednor DOT casa DOT cgf DOT cx> <khk62q$6n2$1 AT ger DOT gmane DOT org> <20130311143630 DOT GA6498 AT ednor DOT casa DOT cgf DOT cx> <khlbm8$5tg$1 AT ger DOT gmane DOT org>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:22.0) Gecko/20100101 Thunderbird/22.0a1
In-Reply-To: <khlbm8$5tg$1@ger.gmane.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019