Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

To err is human, to moo bovine.


devel / comp.lang.tcl / Sync interpreter access from another thread

SubjectAuthor
* Sync interpreter access from another threadheinrichmartin
`* Sync interpreter access from another threadChristian Werner
 `- Sync interpreter access from another threadheinrichmartin

1
Sync interpreter access from another thread

<6907fd05-46a8-446e-85b3-58d7e240d520n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12717&group=comp.lang.tcl#12717

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:7111:0:b0:412:233d:39dc with SMTP id z17-20020ac87111000000b00412233d39dcmr125730qto.0.1698582993326;
Sun, 29 Oct 2023 05:36:33 -0700 (PDT)
X-Received: by 2002:a05:6808:1390:b0:3ad:29a4:f54f with SMTP id
c16-20020a056808139000b003ad29a4f54fmr2962060oiw.4.1698582993178; Sun, 29 Oct
2023 05:36:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.niel.me!glou.org!news.glou.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sun, 29 Oct 2023 05:36:32 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=84.115.226.99; posting-account=Od2xOAoAAACEyRX3Iu5rYt4oevuoeYUG
NNTP-Posting-Host: 84.115.226.99
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6907fd05-46a8-446e-85b3-58d7e240d520n@googlegroups.com>
Subject: Sync interpreter access from another thread
From: martin.heinrich@frequentis.com (heinrichmartin)
Injection-Date: Sun, 29 Oct 2023 12:36:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: heinrichmartin - Sun, 29 Oct 2023 12:36 UTC

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

Re: Sync interpreter access from another thread

<988f437d-7b6b-485f-982a-cb4092b98064n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12718&group=comp.lang.tcl#12718

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ad4:48d4:0:b0:66d:3111:2918 with SMTP id v20-20020ad448d4000000b0066d31112918mr136491qvx.9.1698590568203;
Sun, 29 Oct 2023 07:42:48 -0700 (PDT)
X-Received: by 2002:a05:6808:f01:b0:3ad:f860:b315 with SMTP id
m1-20020a0568080f0100b003adf860b315mr2789061oiw.2.1698590567963; Sun, 29 Oct
2023 07:42:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sun, 29 Oct 2023 07:42:47 -0700 (PDT)
In-Reply-To: <6907fd05-46a8-446e-85b3-58d7e240d520n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.142.202.171; posting-account=wi8XUAkAAADhgxlOTzYRDqsuN4By_ngW
NNTP-Posting-Host: 80.142.202.171
References: <6907fd05-46a8-446e-85b3-58d7e240d520n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <988f437d-7b6b-485f-982a-cb4092b98064n@googlegroups.com>
Subject: Re: Sync interpreter access from another thread
From: undroidwish@gmail.com (Christian Werner)
Injection-Date: Sun, 29 Oct 2023 14:42:48 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: Christian Werner - Sun, 29 Oct 2023 14:42 UTC

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

Re: Sync interpreter access from another thread

<28c2c65f-b60e-4a3d-bf4e-73991f6cf9dbn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12721&group=comp.lang.tcl#12721

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:5307:0:b0:419:a33e:e6fa with SMTP id t7-20020ac85307000000b00419a33ee6famr248678qtn.5.1698650369189;
Mon, 30 Oct 2023 00:19:29 -0700 (PDT)
X-Received: by 2002:a05:6808:180b:b0:3ad:da36:1dd6 with SMTP id
bh11-20020a056808180b00b003adda361dd6mr4936614oib.1.1698650368937; Mon, 30
Oct 2023 00:19:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 30 Oct 2023 00:19:28 -0700 (PDT)
In-Reply-To: <988f437d-7b6b-485f-982a-cb4092b98064n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.115.227.15; posting-account=Od2xOAoAAACEyRX3Iu5rYt4oevuoeYUG
NNTP-Posting-Host: 84.115.227.15
References: <6907fd05-46a8-446e-85b3-58d7e240d520n@googlegroups.com> <988f437d-7b6b-485f-982a-cb4092b98064n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <28c2c65f-b60e-4a3d-bf4e-73991f6cf9dbn@googlegroups.com>
Subject: Re: Sync interpreter access from another thread
From: martin.heinrich@frequentis.com (heinrichmartin)
Injection-Date: Mon, 30 Oct 2023 07:19:29 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1911
 by: heinrichmartin - Mon, 30 Oct 2023 07:19 UTC

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!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor