Pop-Up Thingie

>>> Magnum BBS <<<
  • Home
  • Forum
  • Files
  • Log in

  1. Forum
  2. Usenet
  3. COMP.LANG.TCL
  • Sync interpreter access from another thread

    From heinrichmartin@21:1/5 to All on Sun Oct 29 05:36:32 2023
    Hi Tclers,
    I want to provide a Tcl wrapper to a C API. That should be straight forward, except for the callback from another thread. Can anyone point me to how to make the callback available as a Tcl event, e.g. write a variable in a thread safe way to trigger
    vwait?
    If possible, I want to avoid Tcl threads and busy waiting.
    TIA
    Martin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Werner@21:1/5 to All on Sun Oct 29 07:42:47 2023
    Martin,

    there are some C coded extensions in the www.androwish.org repository which use Tcl_ThreadQueueEvent() for triggering events in a Tcl thread from another thread, see e.g.

    https://www.androwish.org/home/file?name=jni/ZBar/tcl/tclzbar.c&ci=tip https://www.androwish.org/home/file?name=jni/tcluvc/tcluvc.c&ci=tip https://www.androwish.org/home/file?name=undroid/tclwmf/tclwmf.c&ci=tip

    HTH,
    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From heinrichmartin@21:1/5 to Christian Werner on Mon Oct 30 00:19:28 2023
    On Sunday, October 29, 2023 at 3:42:50 PM UTC+1, Christian Werner wrote:
    Martin,

    there are some C coded extensions in the www.androwish.org repository which use Tcl_ThreadQueueEvent() for triggering events in a Tcl thread from another thread, see e.g.

    https://www.androwish.org/home/file?name=jni/ZBar/tcl/tclzbar.c&ci=tip https://www.androwish.org/home/file?name=jni/tcluvc/tcluvc.c&ci=tip https://www.androwish.org/home/file?name=undroid/tclwmf/tclwmf.c&ci=tip

    HTH,
    Christian

    This looks exactly like my missing link. Thanks for the reference and the example!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • Who's Online

  • System Info

    Sysop: Keyop
    Location: Huddersfield, West Yorkshire, UK
    Users: 716
    Nodes: 16 (2 / 14)
    Uptime: 56:53:23
    Calls: 12,117
    Files: 15,010
    Messages: 6,518,672

© >>> Magnum BBS <<<, 2026