This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Attachment:
lockFail.txt
Description: Text document
from Queue import Queue from threading import Thread def echoer( Q1, Q2 ): while 1: o = Q1.get() Q2.put( o ) def writer( Q, values ): for i in values: Q.put( i ) def reader( Q, values ): for i in values: msg = Q.get() assert msg == i def test_session( Qsize, msgs ): q1 = Queue( Qsize ) q2 = Queue( Qsize ) e = Thread( target=echoer, args=( q1, q2 ) ) e.setDaemon( True ) e.start() w = Thread( target=writer, args=( q1, msgs ) ) w.start() r = Thread( target=reader, args=( q2, msgs ) ) r.start() msgs = range(10000) print "each test group is testing %d items" % len( msgs ) test_session( 0, msgs ) test_session( 40, msgs ) #test_session( 20, msgs ) #test_session( 5, msgs ) #test_session( 50, msgs ) #test_session( 500, msgs ) #test_session( 50000, msgs )
Attachment:
srv.txt
Description: Text document
Thanks, --Doug
-- 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/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |