Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Disclaimer: "These opinions are my own, though for a small fee they be yours too." -- Dave Haynie


devel / comp.lang.tcl / Re: thread::create create 2 system threads instead of one

SubjectAuthor
* thread::create create 2 system threads instead of oneОлег Н.
`* Re: thread::create create 2 system threads instead of oneHarald Oehlmann
 `- Re: thread::create create 2 system threads instead of oneОлег Н.

1
thread::create create 2 system threads instead of one

<0971ffe2-4e3d-40be-a83b-eca768365d2bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Forwarded-Encrypted: i=1; AJvYcCU9DjS4iEKqt6npOaonl+qed9TdGgJEdzWfvwsSJwqD9HUSO2/iBtHV1dLOMyS85XVL9GmbFBfWcIN0qix3cD5Znc6ZHx8RXxZBph5JcKW8Isw=
X-Received: by 2002:a05:622a:296:b0:42e:32b6:8e56 with SMTP id z22-20020a05622a029600b0042e32b68e56mr76918qtw.7.1708593054384;
Thu, 22 Feb 2024 01:10:54 -0800 (PST)
X-Forwarded-Encrypted: i=1; AJvYcCXEOUVoZfJUxabR9Sob1UhLUfvUCp/MBugIz0h877SGG2DezB6CULDUuHfS3dYApSyg6No37stAQ/5pRAbdB/0FM+M3BYN1ZW5JdzQDod6+
X-Received: by 2002:a05:6214:5003:b0:68f:9bc4:f258 with SMTP id
jo3-20020a056214500300b0068f9bc4f258mr247983qvb.0.1708593054093; Thu, 22 Feb
2024 01:10:54 -0800 (PST)
Path: i2pn2.org!i2pn.org!news.swapon.de!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: Thu, 22 Feb 2024 01:10:53 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=uOZ-YwoAAAA2iL3syeR4eV868hXjkmW-
NNTP-Posting-Host: 194.190.114.28
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0971ffe2-4e3d-40be-a83b-eca768365d2bn@googlegroups.com>
Subject: thread::create create 2 system threads instead of one
From: oleg.n4yt@gmail.com (Олег Н.)
Injection-Date: Thu, 22 Feb 2024 09:10:54 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2094
 by: Олег Н. - Thu, 22 Feb 2024 09:10 UTC

Hi, all.

Can anybody explain why first call of thread::create makes 2 system threads instead of one?

For example, we have t.tcl script:
~$ cat t.tcl
#!/usr/bin/tclsh

package require Thread

puts "stage1"
after 10000
thread::create {thread::wait}

puts "stage2"
after 10000

thread::create {thread::wait}

puts "stage3"
after 10000

We run it. And check system threads on every stage change:
~$ ps -aL | grep t.tcl
8134 8134 pts/2 00:00:00 t.tcl
~$ ps -aL | grep t.tcl
8134 8134 pts/2 00:00:00 t.tcl
8134 8372 pts/2 00:00:00 t.tcl
8134 8373 pts/2 00:00:00 t.tcl
~$ ps -aL | grep t.tcl
8134 8134 pts/2 00:00:00 t.tcl
8134 8372 pts/2 00:00:00 t.tcl
8134 8373 pts/2 00:00:00 t.tcl
8134 8605 pts/2 00:00:00 t.tcl

Re: thread::create create 2 system threads instead of one

<ur73kl$3pri6$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: thread::create create 2 system threads instead of one
Date: Thu, 22 Feb 2024 10:20:21 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <ur73kl$3pri6$1@dont-email.me>
References: <0971ffe2-4e3d-40be-a83b-eca768365d2bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 22 Feb 2024 09:20:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e4ce0a6679f9a2132394f22813a2212c";
logging-data="3993158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0yOLn9szCnz9GFDzGEvqF"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JwuYDtfjEO45ZZfb8RAC3a0nEoQ=
In-Reply-To: <0971ffe2-4e3d-40be-a83b-eca768365d2bn@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Thu, 22 Feb 2024 09:20 UTC

Am 22.02.2024 um 10:10 schrieb Олег Н.:
> Hi, all.
>
> Can anybody explain why first call of thread::create makes 2 system threads instead of one?
>
> For example, we have t.tcl script:
> ~$ cat t.tcl
> #!/usr/bin/tclsh
>
> package require Thread
>
> puts "stage1"
> after 10000
> thread::create {thread::wait}
>
> puts "stage2"
> after 10000
>
> thread::create {thread::wait}
>
> puts "stage3"
> after 10000
>
> We run it. And check system threads on every stage change:
> ~$ ps -aL | grep t.tcl
> 8134 8134 pts/2 00:00:00 t.tcl
> ~$ ps -aL | grep t.tcl
> 8134 8134 pts/2 00:00:00 t.tcl
> 8134 8372 pts/2 00:00:00 t.tcl
> 8134 8373 pts/2 00:00:00 t.tcl
> ~$ ps -aL | grep t.tcl
> 8134 8134 pts/2 00:00:00 t.tcl
> 8134 8372 pts/2 00:00:00 t.tcl
> 8134 8373 pts/2 00:00:00 t.tcl
> 8134 8605 pts/2 00:00:00 t.tcl
>

Hi Oleg,
what is your platform? If it is linux, which threadding system was
compiled in (pthreads) (found by the configure script).

Take care,
Harald

Re: thread::create create 2 system threads instead of one

<c7a898a1-f8ce-4769-ab70-e56facf9c0f5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Forwarded-Encrypted: i=1; AJvYcCUQ5iNgQxZh31RGBrGCPgxODWqiva3ta8DeDAaV9izE/Iru3gAALY/nDtW1N+ODDjMXqpdw/LCk9Ewpi90acphn6/qB8iE2Z/sBIzd4LDS6Mg==
X-Received: by 2002:a05:620a:1b94:b0:787:1a34:27bd with SMTP id dv20-20020a05620a1b9400b007871a3427bdmr165449qkb.5.1708593913356;
Thu, 22 Feb 2024 01:25:13 -0800 (PST)
X-Forwarded-Encrypted: i=1; AJvYcCUtCQBOKzeHNj4uFz/gfgEMhBkIVWuEssj/sDCmNjfa1vuHL+lm3u6VOZofMJbfDUkOOGIwK01GWJH2/1/gbgWShD2fvpceP/jgaZ433ydx
X-Received: by 2002:a05:622a:20d:b0:42e:16ae:6e0f with SMTP id
b13-20020a05622a020d00b0042e16ae6e0fmr149337qtx.11.1708593913113; Thu, 22 Feb
2024 01:25:13 -0800 (PST)
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: Thu, 22 Feb 2024 01:25:12 -0800 (PST)
In-Reply-To: <ur73kl$3pri6$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=uOZ-YwoAAAA2iL3syeR4eV868hXjkmW-
NNTP-Posting-Host: 194.190.114.28
References: <0971ffe2-4e3d-40be-a83b-eca768365d2bn@googlegroups.com> <ur73kl$3pri6$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c7a898a1-f8ce-4769-ab70-e56facf9c0f5n@googlegroups.com>
Subject: Re: thread::create create 2 system threads instead of one
From: oleg.n4yt@gmail.com (Олег Н.)
Injection-Date: Thu, 22 Feb 2024 09:25:13 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: Олег Н. - Thu, 22 Feb 2024 09:25 UTC

> Hi Oleg,
> what is your platform? If it is linux, which threadding system was
> compiled in (pthreads) (found by the configure script).

Oops. Forgot to say. I use Linux based os.
% array get tcl_platform
osVersion 5.4.247-my pointerSize 8 byteOrder littleEndian threaded 1 machine x86_64 platform unix pathSeparator : os Linux engine Tcl user lego wordSize 8
~$ ldd `which tclsh` | grep thread
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f7bad070000)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor