config root man

Current Path : /usr/local/lib/python2.5/bsddb/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/bsddb/test/test_thread.pyo

³ò
h”Rc@s¯dZddkZddkZddkZddkZddkZddkZddklZddklZye	e
fWnej
odZ	dZ
nXdZy ddk
lZlZe	ZWnej
o
e
ZnXyeWn)ej
od	efd
„ƒYZnXddkZddklZyddklZlZWn)ej
oddklZlZnXd
eifd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ de fd„ƒYZ!de fd„ƒYZ"defd„ƒYZ#de#fd„ƒYZ$de#fd „ƒYZ%d!e#fd"„ƒYZ&d#e#fd$„ƒYZ'd%„Z(e)d&joei*d'd(ƒndS()s-TestCases for multi-threaded access to a DB.
iÿÿÿÿN(tpprint(trandomiit-(tThreadt
currentThreadtWindowsErrorcBseZRS((t__name__t
__module__(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRs(tverbose(tdbtdbutilstBaseThreadedTestCasecBsGeZeiZdZdZdZd„Zd„Z	d„Z
d„ZRS(icCs4totit_ntiitiiti	dƒdƒ}||_
yti|ƒWn/tj
o#}|i
t
ijo‚q‹nXtiƒ|_|iƒ|ii||itiBƒ|iid|_ti|iƒ|_|io|ii|iƒn|ii|i|i|itiBƒdS(Nitdb_homes.db(RtsyststdoutR
t_deadlock_VerboseFiletostpathtjointdirnametargvthomeDirtmkdirtOSErrorterrnotEEXISTR	tDBEnvtenvt
setEnvOptstopentenvflagst	DB_CREATEt	__class__RtfilenametDBtdt
dbsetflagst	set_flagstdbtypetdbopenflags(tselfRte((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pytsetUp4s"(	

cCs.|iiƒ|iiƒti|iƒdS(N(R#tcloseRtshutiltrmtreeR(R(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyttearDownHs

cCsdS(N((R(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRMscCsti|gdƒS(Ni(tDASHR(R(tkey((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pytmakeDataPs(RRR	t
DB_UNKNOWNR&R'R$RR*R.RR1(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR.s				tConcurrentDataStoreBasecBsUeZeiZeieiBeiBZdZdZ	dZ
d„Zd„Zd„Z
RS(iiècCsto dGddGHd|iiGHng}xUt|iƒD]D}td|id|i|i|fdd|ƒ}|i	|ƒq=WxOt|i
ƒD]>}td|id|i|fdd	|ƒ}|i	|ƒq•Wx|D]}|iƒqÞWx|D]}|i
ƒqùWdS(
Ns
s-=is(Running %s.test01_1WriterMultiReaders...ttargettargstnames	writer %ds	reader %d(RR RtrangetwritersRtwriterThreadR#trecordstappendtreaderstreaderThreadtstartR(R(tthreadstxtwttrttt((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyttest01_1WriterMultiReaders^s.


c	Csëtƒiƒ}||}||dd}tod|||fGHnxtt||ƒD]c}d|}ti|i||i|ƒddƒto'|ddjod|||fGHqXqXWto
d	|GHnto
d
|GHndS(Nis%s: creating records %d - %ds%04dtmax_retriesiidis%s: records %d - %d finisheds%s: finished creating recordss%s: thread finished(RtgetNameRR7R
tDeadlockWraptputR1(	R(R#thowManyt	writerNumR6R>tstopR@R0((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR9xs 



c
Csètid|ƒtƒiƒ}x­tdƒD]Ÿ}|iƒ}d}|iƒ}xG|o?|d7}|\}}	|i|i|ƒ|	ƒ|i	ƒ}qTWt
od||fGHn|iƒtidƒq-Wt
o
d|GHndS(Ng{®Gáz„?iiis%s: found %d recordsgš™™™™™©?s%s: thread finished(ttimetsleepRRFR7tcursortfirsttassertEqualR1tnextRR+(
R(R#t	readerNumR6tlooptctcounttrecR0tdata((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR=˜s&


(RRR	t	DB_THREADR'tDB_INIT_CDBt
DB_INIT_MPOOLRR<R8R:RDR9R=(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR3Ws			 tBTreeConcurrentDataStorecBs#eZeiZdZdZdZRS(ii
iè(RRR	tDB_BTREER&R8R<R:(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR[®s	tHashConcurrentDataStorecBs#eZeiZdZdZdZRS(ii
iè(RRR	tDB_HASHR&R8R<R:(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR]µs	tSimpleThreadedBasecBs^eZeiZeieiBeiBZdZdZ	dZ
d„Zd„Zd„Z
d„ZRS(iiiècCs|iitiƒdS(N(Rt
set_lk_detectR	tDB_LOCK_DEFAULT(R(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRÅscCsto dGddGHd|iiGHng}xUt|iƒD]D}td|id|i|i|fdd|ƒ}|i	|ƒq=WxOt|i
ƒD]>}td|id|i|fdd	|ƒ}|i	|ƒq•Wx|D]}|iƒqÞWx|D]}|i
ƒqùWdS(
Ns
s-=is Running %s.test02_SimpleLocks...R4R5R6s	writer %ds	reader %d(RR RR7R8RR9R#R:R;R<R=R>R(R(R?R@RARBRC((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyttest02_SimpleLocksÈs,


cCsUtƒiƒ}||}||dd}tod|||fGHnxàt||ƒD]Ï}d|}ti|i||i|ƒddƒto'|ddjod|||fGHntƒd	jo\xYt||ƒD]D}	d|}ti|i	|ddƒ}
|i
|
|i|ƒƒqÛWqXqXWyti|iddƒWn(ti
j
o}to	d
GHqpnXxÊt||ƒD]¹}d|}ti|i	|ddƒ}
to'|ddjod|||
fGHn|i
|
|i|ƒƒtƒdjo7ti|i|ddƒtod
||fGHq9q€q€Wto
d|GHndS(Nis%s: creating records %d - %ds%04dREiidis%s: records %d - %d finishedgš™™™™™©?scould not complete sync()...s%s: fetched record (%s, %s)gš™™™™™¹?s%s: deleted record %ss%s: thread finished(RRFRtxrangeR
RGRHR1RtgetRPtsyncR	tDBIncompleteErrortdelete(R(R#RIRJR6R>RKR@R0tyRWtval((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR9àsH


%
c
Cstid|ƒtƒiƒ}xÅtdƒD]·}|iƒ}d}ti|iddƒ}xS|oK|d7}|\}}	|i	|i
|ƒ|	ƒti|iddƒ}q`Wtod||fGHn|i
ƒtidƒq-Wto
d	|GHndS(
Ng{®Gáz„?iiREi
is%s: found %d recordsgš™™™™™©?s%s: thread finished(RLRMRRFR7RNR
RGRORPR1RQRR+(
R(R#RRR6RSRTRURVR0RW((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR=
s&


(RRR	RXR'RZtDB_INIT_LOCKRR<R8R:RRbR9R=(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR_¾s				-tBTreeSimpleThreadedcBseZeiZRS((RRR	R\R&(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRk#stHashSimpleThreadedcBseZeiZRS((RRR	R^R&(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRl'stThreadedTransactionsBasecBs‹eZeieiBZeieiBeiBeiBei	BZ
dZdZdZ
dZd„Zd„Zd„Zd„Zd„Zd„ZRS(iiÐcCsdS(N((R(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR;scCs@to dGddGHd|iiGHng}xUt|iƒD]D}td|id|i|i|fdd|ƒ}|i	|ƒq=WxOt|i
ƒD]>}td|id|i|fdd	|ƒ}|i	|ƒq•Wtd|iƒ}|i
ƒx|D]}|i
ƒqúWx|D]}|iƒqWt|_|iƒdS(
Ns
s-=is)Running %s.test03_ThreadedTransactions...R4R5R6s	writer %ds	reader %d(RR RR7R8RR9R#R:R;R<R=tdeadlockThreadR>RtFalsetdoLockDetect(R(R?R@RARBtdtRC((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyttest03_ThreadedTransactions?s6



	c
Cst}xÿ|p÷yš|iid|iƒ}xkt||ƒD]Z}d|}|i||i|ƒ|ƒto'|ddjod|||fGHq;q;W|i	ƒt
}Wq	titi
fj
o>}	tod||	dfGHn|iƒtidƒq	Xq	WdS(Ns%04didis%s: records %d - %d finisheds%s: Aborting transaction (%s)igš™™™™™©?(RoRt	txn_begintNonettxnFlagR7RHR1RtcommittTrueR	tDBLockDeadlockErrortDBLockNotGrantedErrortabortRLRM(
R(R#R6R>RKtfinishedttxnR@R0Ri((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pytdoWrite_s$



cCs	tƒiƒ}||}||dd}tod|||fGHnd}x=t|||ƒD])}|i|||t|||ƒƒqaWto
d|GHnto
d|GHnt}	x2|	p*yÍg}
|iid|i
ƒ}x~tdƒD]p}ttƒ|ƒ|}d|}|i
|d|tiƒ}
|
dj	o!|i||ƒ|
i|ƒqôqôW|iƒt}	tod||
fGHnWq¿titifj
o>}tod	||dfGHn|iƒtid
ƒq¿Xq¿Wto
d|GHndS(Nis%s: creating records %d - %dids%s: finished creating recordss%s: deleting a few recordsi
s%04ds%s: deleted records %ss%s: Aborting transaction (%s)gš™™™™™©?s%s: thread finished(RRFRR7R}tminRoRRsRtRutintRRdR	tDB_RMWRgR;RvRwRxRyRzRLRM(R(R#RIRJR6R>RKtstepR@R{trecsR|R0RWRi((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR9qsL
'






c
Cs“tid|dƒtƒiƒ}xTtdƒD]F}t}x*|p"y»|iid|i	ƒ}|i
|ƒ}d}|iƒ}	xG|	o?|d7}|	\}
}|i|i
|
ƒ|ƒ|iƒ}	q†Wtod||fGHn|iƒ|iƒt}Wq@titifj
oH}tod||dfGHn|iƒ|iƒtidƒq@Xq@Wtidƒq1Wto
d|GHndS(	Ng{®Gáz„?gš™™™™™©?iiis%s: found %d recordss%s: Aborting transaction (%s)s%s: thread finished(RLRMRRFR7RoRRsRtRuRNRORPR1RQRR+RvRwR	RxRyRz(
R(R#RRR6RSR{R|RTRURVR0RWRi((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR=šs@






cCst|_xo|iodtidƒy:|iititiƒ}t	o|o
d|GHnWqti
j
oqXqWdS(Ngà?s.deadlock: Aborted %d deadlocked transaction(s)(RwRpRLRMRtlock_detectR	tDB_LOCK_RANDOMtDB_LOCK_CONFLICTRtDBError(R(taborted((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRn»s	

	(RRR	RXtDB_AUTO_COMMITR'RZRjtDB_INIT_LOGtDB_INIT_TXNRR<R8R:RuRRrR}R9R=Rn(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRm.s
		 		)	!tBTreeThreadedTransactionscBs#eZeiZdZdZdZRS(iiiÐ(RRR	R\R&R8R<R:(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyR‹És	tHashThreadedTransactionscBs#eZeiZdZdZdZRS(iiiÐ(RRR	R^R&R8R<R:(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRŒÏs	tBTreeThreadedNoWaitTransactionscBs,eZeiZdZdZdZeiZ	RS(iiiÐ(
RRR	R\R&R8R<R:t
DB_TXN_NOWAITRu(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRÕs
	tHashThreadedNoWaitTransactionscBs,eZeiZdZdZdZeiZ	RS(iiiÐ(
RRR	R^R&R8R<R:RŽRu(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyRÜs
	cCsÐtiƒ}to´|ititƒƒ|ititƒƒ|ititƒƒ|ititƒƒ|itit	ƒƒ|itit
ƒƒ|ititƒƒ|ititƒƒndGH|S(Ns-Threads not available, skipping thread tests.(
tunittestt	TestSuitethave_threadstaddTestt	makeSuiteR[R]RkRlR‹RŒRR(tsuite((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pyt
test_suiteæst__main__tdefaultTestR–(+t__doc__RR
RLRR,ttempfileRRRwRot	NameErrorR/t	threadingRRR’tImportErrorRt	ExceptionRttest_allRtbsddb3R	R
tbsddbtTestCaseRR3R[R]R_RkRlRmR‹RŒRRR–Rtmain(((s2/usr/local/lib/python2.5/bsddb/test/test_thread.pys<module>sX
)W	e›
	


Man Man