Artifacts Associated With Ticket 994229ffffffffffffffffffffffffffffffffff
Ticket change [1a00ecab30] (rid 122901) by nobody on 2004-07-20 02:27:11:
- assignee initialized to: "vasiljevic"
- cmimetype initialized to: "text/plain"
- comment initialized to:
A [tsv::lock <arrayName>] will not prevent two threads from accessing the tsv array. % puts $tcl_version 8.4 % array get tcl_platform osVersion 7.3.0 byteOrder bigEndian threaded 1 machine {Power Macintosh} platform unix os Darwin user ts anders wordSize 4 % package require Thread 2.5 Testcase: package require Thread tsv::set global true 1 tsv::set global false 0 set a [thread::create] set b [thread::create] set ::finish 0 thread::send $a [list set x [thread::id]]; # main thread id thread::send -async $a { set ::finish 0 puts "a: [thread::id]" tsv::lock global { puts "a: has global lock ([tsv::get global true])" tsv::set global true 2 vwait ::finish } puts "a: released global lock" thread::send $::x {incr ::finish} } # kick thread a out of lock after 5000 {thread::send $a {incr ::finish}} after 1000 { thread::send -async $b { puts "b: [thread::id], waiting for global lock" tsv::lock global { puts "b: got global lock ([tsv::get global true])" } puts "b: released global lock" } } vwait ::finish Output: a: 25173504 a: has global lock (1) b: 25174528, waiting for global lock b: got global lock (2) b: released global lock a: released global lock You can see that b was able to obtain the lock and access the tsv global array data while thread 'a' had the lock. I saw one message in the forum about this also but the person never got an answer there. Any clues? I peeked at the code and didn't see an immediate problem but I'm not familiar with that code at all. sanders012<at>earth.com - foundin initialized to: "obsolete: 8.4.6"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "80. Thread Package"
- title initialized to: "tsv::lock doesn't lock between threads"
- type initialized to: "Bug"
Ticket change [b80480d6c8] (rid 128899) by vasiljevic on 2004-07-20 17:01:44:
- icomment:
Logged In: YES user_id=95086 Yes. This is still wrong in the 2.5.1 I'm trying to catch up with 2.6 which corrects this problem. I still need to cleanup the docs and write test-suite for tpool and tsv commands. As the matter of fact, I can already check-in the changes in the head branch so you can test it out. Given the high-load I have at work, I cannot promise to release 2.6 in next 3-4 weeks. But, the cvs head should be stable enough to use. Please do checkout the head in 2-3 days again and give it a try. I will leave this bug report open until I release the 2.6 version.
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [09a543994e] (rid 113695) by tsanders on 2004-07-20 23:35:56:
- icomment:
Logged In: YES user_id=1087228 A quick test against HEAD using my testcase (and application) seems to be working ok. I'll let you know if any issues pop up. I'll also watch for any further checkin's and track the changes. Thanks for the quick response and all the work on the thread library too.
- login: "tsanders"
- mimetype: "text/plain"
- username: "tsanders"
- icomment:
Ticket change [474a5cdb2b] (rid 99674) by vasiljevic on 2004-07-22 04:12:16:
- icomment:
Logged In: YES user_id=95086 I have updated the cvs head with my latest changes. Please try it again. Also, read the ChangeLog to see what is new. This bug-report will be left open until I really release the 2.6. On todo list are just tpool.test, tsv.test and ttrace.test files which need to be written new.
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [2a7200b2c6] (rid 118573) by vasiljevic on 2004-11-25 23:07:16:
- closedate changed to: "2004-11-25T16:07:16"
- closer changed to: "vasiljevic"
- icomment:
Logged In: YES user_id=95086 Closing this one since the 2.6 is underway
- login: "vasiljevic"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vasiljevic"