Tcl package Thread source code

Ticket Change Details
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.
Overview

Artifact ID: b7570ded1ea3b1fbe7190af8317d68436c177c8b1479c3d6180f1f1e22ca0937
Ticket: c6057948e5f884435ee35517008db0205f286a5e
tsv commands break thread access rules for Tcl values
User & Date: dgp 2018-03-29 23:04:16
Changes

  1. Change icomment to:

    With that background information, and using a --enable-symbols=mem build of Tcl, run this demo script:

    package require Thread

    proc myScript mainTid { package require Thread thread::send -async $mainTid [list puts "ThreadRunning = [tsv::get sharedArray ThreadRunning]"] tsv::set sharedArray ThreadRunning 1 thread::send -async $mainTid [list puts "ThreadRunning = [tsv::get sharedArray ThreadRunning]"] }

    proc installProc {tid procName} { set procBody [info body $procName] set procArgs [info args $procName] thread::send $tid [list proc $procName $procArgs $procBody] }

    tsv::set sharedArray ThreadRunning 0 set _threadHandle [thread::create] installProc $_threadHandle myScript thread::send -async $_threadHandle [list myScript [thread::id]]

    after 1000

    puts "\t Completed tests"

    With any luck, one of those Panic safeguards will be triggered.

  2. Change login to "dgp"
  3. Change mimetype to "text/plain"