I experimeneted withthreads and I get a strange behabiour. it looks 
like one thread takes over sqlite and does not leave it until it is 
finished even though I tell it to wait. this is the script I use: 
package require sqlite3 
package require Thread 

sqlite3 conn test 
catch {conn eval "drop  table a"} 
conn eval "create table a (b varchar(10))" 
set t1 [thread::create] 
set t2 [thread::create] 
set b { 
package require sqlite3 
sqlite3 conn test 
conn timeout 100000 
for {set i 0} {$i<10} {incr i} { 
puts $i-[thread::id] 
conn eval "insert into a values ($i-[thread::id])" 
after 1 


} 
thread::exit 
} 


thread:::send -async $t1 $b 
thread:::send -async $t2 $b 
thread::wait 

the result is: 
0-65539 
0-81924 
1-65539 
2-65539 
3-65539 
4-65539 
5-65539 
6-65539 
7-65539 
8-65539 
9-65539 
1-81924 
2-81924 
3-81924 
4-81924 
5-81924 
6-81924 
7-81924 
8-81924 
9-81924 


why in the start both threads get access? 
why after it only thread 1 access it and thread 2 starts only when 
thread 1 finishes 






-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to