Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7a74c9b76dedb83fd3ba799751f7bfecdbd01f42
Ticket: 2869384fffffffffffffffffffffffffffffffff
Tcl_AsyncMark does not work with --enable-threads
User & Date: eugene_cdn on 2009-09-29 19:46:13
Changes

  1. icomment:
    I don't think that recursive mutex will help. Cannot modify global data safely in a signal handler without be sure that you are alone.
    Agree that the problem cannot be solved without help of another thread that does not receive signals.
    Please also note that there may be several signals come before "end of special handling".
    Draft idea:
    Need a thread that blocks all signals (except, maybe one, usr123) or does not use notifierMutex. Let's call it right_thread.
    AsyncMark:
    - if (trylock(&notifierMutex) == 0)
    -    // normal code
    - lock (&another_mutex)
    - queue async_tls_data
    - unlock (&another_mutex)
    - wake up right_thread (using pthread_kill(right_thread,usr123) or pthread_cond_signal)
    right_thread:
    - lock (&another_mutex)
    - take asyn_tls_data from queue
    - save async_tls_data to right interp
    - unlock (&another_mutex)
    
    There is a non-blocking technique to modify global data. May also be used in any solution.
    
    
  2. login: "eugene_cdn"
  3. mimetype: "text/plain"
  4. username: "eugene_cdn"