Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f04fb47697f3d7b26586c928d183cd5bde9627fd1fdf6adc4d17c14912739c77
Ticket: 0f439992eff158ca991ee191f89a6bd4c4eb51e9
Checking data consistency for unlocking of mutexes
User & Date: elfring on 2019-05-06 09:27:07
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    I am trying again to get a multi-threaded data processing approach working also together with the programming language “TCL 8.6.9-1.5” on an openSUSE system.
    Unfortunately, I have detected another questionable software behaviour during my tests.
    
    Test output example:
    …
    3. run
    mutex is not locked
        while executing
    "thread::mutex unlock [tsv::get shared pcm]"
        (procedure "main_thread_unlock_start" line 1)
        invoked from within
    "main_thread_unlock_start"
        (procedure "perform_command" line 92)
        invoked from within
    "perform_command"
        (procedure "repeat_command" line 4)
        invoked from within
    "repeat_command"
        (procedure "run_analysis" line 2)
        invoked from within
    "run_analysis"
        (file "test-statistic-server2c.tcl" line 221)
    
    
    How can such a software surprise happen when this script provides the following source code at the affected place and similar command calls at related places?
    (By the way: Scoped locks could reduce the programming efforts for the desired data consistency, couldn't they?)
    
    …
    proc perform_command {} \
    {
    tsv::set shared pcm [thread::mutex create]
    thread::mutex lock [tsv::get shared pcm]
    
    try \
       {
       tsv::set shared pcc [thread::cond create]
    …
       } \
    finally \
       {
       proc main_thread_unlock_start {} \
       {thread::mutex unlock [tsv::get shared pcm]}
       main_thread_unlock_start
       }
    …
    
  5. foundin changed to: "8.6.9"
  6. is_private changed to: "0"
  7. login: "elfring"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "elfring"
  13. subsystem changed to: "80. Thread Package"
  14. title changed to: "Checking data consistency for unlocking of mutexes"
  15. type changed to: "Bug"