Skip to content
Tcl Source Code History Of Ticket 994229ffffffffff
Login

History Of Ticket 994229ffffffffff

Artifacts Associated With Ticket 994229ffffffffff

  1. Ticket change [1a00ecab30] (rid 122901) by nobody on 2004-07-20 02:27:11:

    1. assignee initialized to: "vasiljevic"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.4.6"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "80. Thread Package"
    10. title initialized to: "tsv::lock doesn't lock between threads"
    11. type initialized to: "Bug"
  2. Ticket change [b80480d6c8] (rid 128899) by vasiljevic on 2004-07-20 17:01:44:

    1. 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.  
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  3. Ticket change [09a543994e] (rid 113695) by tsanders on 2004-07-20 23:35:56:

    1. 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.
      
      
    2. login: "tsanders"
    3. mimetype: "text/plain"
    4. username: "tsanders"
  4. Ticket change [474a5cdb2b] (rid 99674) by vasiljevic on 2004-07-22 04:12:16:

    1. 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. 
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  5. Ticket change [2a7200b2c6] (rid 118573) by vasiljevic on 2004-11-25 23:07:16:

    1. closedate changed to: "2004-11-25T16:07:16"
    2. closer changed to: "vasiljevic"
    3. icomment:
      Logged In: YES 
      user_id=95086
      
      Closing this one since the 2.6 is underway 
      
      
    4. login: "vasiljevic"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "vasiljevic"