Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

21 May, 2024: Computers section is temporarily disabled for maintenance. It will take several days before it's back.


devel / comp.lang.tcl / limit on threads?

SubjectAuthor
* limit on threads?saitology9
`* Re: limit on threads?Rich
 `* Re: limit on threads?saitology9
  `* Re: limit on threads?Rich
   `* Re: limit on threads?Joerg Mertens
    `* Re: limit on threads?Rich
     `- Re: limit on threads?Joerg Mertens

1
limit on threads?

<uaeisa$9s96$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22507&group=comp.lang.tcl#22507

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: limit on threads?
Date: Wed, 2 Aug 2023 17:46:49 -0400
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <uaeisa$9s96$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 21:46:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="07d1f0de7b9ad0df2f3da389d4454138";
logging-data="323878"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+agwRPKMT9c3KgOOJN45zn"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:41T6xOEGsX9vnsTMFdmXEMwV7wM=
Content-Language: en-US
 by: saitology9 - Wed, 2 Aug 2023 21:46 UTC

Is there a limit on the number of threads you can create in an
interpreter? Out of no where, I started getting error messages saying
that the interpreter "can't create a thread". The man page did not say
anything on this.

Re: limit on threads?

<uael5t$a82n$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22508&group=comp.lang.tcl#22508

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: limit on threads?
Date: Wed, 2 Aug 2023 22:26:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uael5t$a82n$1@dont-email.me>
References: <uaeisa$9s96$1@dont-email.me>
Injection-Date: Wed, 2 Aug 2023 22:26:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5d0f5bfc520c987397bee0084a4754ac";
logging-data="335959"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XIG/LAJw8L89aeHX4bZxm"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:NNd5vbUr9TbyPCFv+H0XZanFBr4=
 by: Rich - Wed, 2 Aug 2023 22:26 UTC

saitology9 <saitology9@gmail.com> wrote:
> Is there a limit on the number of threads you can create in an
> interpreter? Out of no where, I started getting error messages
> saying that the interpreter "can't create a thread". The man page
> did not say anything on this.

Tcl, at least on Linux, seems to impose no limit itself. I tried
creating a huge number not so long ago as a test, and the 'limiting
factor' was the memory consumed by each thread. Eventually the process
would use up all memory in the machine, and become a target for the
Linux OOM killer.

The host OS, however, can enforce a limit if it wants, in which case
Tcl would eventually hit that limit if you create enough threads.

Re: limit on threads?

<uaeqha$aogv$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22509&group=comp.lang.tcl#22509

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: limit on threads?
Date: Wed, 2 Aug 2023 19:57:28 -0400
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uaeqha$aogv$1@dont-email.me>
References: <uaeisa$9s96$1@dont-email.me> <uael5t$a82n$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 23:57:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="188056a9d29608384e2ea35f923ea292";
logging-data="352799"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198fjzFUYPMZjKgTGeCyKnb"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:tNU3E5UbV8tCU9X/YRFL6z7wyUk=
In-Reply-To: <uael5t$a82n$1@dont-email.me>
Content-Language: en-US
 by: saitology9 - Wed, 2 Aug 2023 23:57 UTC

On 8/2/2023 6:26 PM, Rich wrote:
>
> The host OS, however, can enforce a limit if it wants, in which case
> Tcl would eventually hit that limit if you create enough threads.
>

Thanks for the info. This was on Windows 10. It must have been low
memory issue for me.

Re: limit on threads?

<uaf0u2$felr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22510&group=comp.lang.tcl#22510

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: limit on threads?
Date: Thu, 3 Aug 2023 01:46:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uaf0u2$felr$1@dont-email.me>
References: <uaeisa$9s96$1@dont-email.me> <uael5t$a82n$1@dont-email.me> <uaeqha$aogv$1@dont-email.me>
Injection-Date: Thu, 3 Aug 2023 01:46:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5d0f5bfc520c987397bee0084a4754ac";
logging-data="506555"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/hyZr82wiGpJ6eE4ie+mM"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:v1tTLpPtHODaV302ycKWFB66vM4=
 by: Rich - Thu, 3 Aug 2023 01:46 UTC

saitology9 <saitology9@gmail.com> wrote:
> On 8/2/2023 6:26 PM, Rich wrote:
>>
>> The host OS, however, can enforce a limit if it wants, in which case
>> Tcl would eventually hit that limit if you create enough threads.
>>
>
> Thanks for the info. This was on Windows 10. It must have been low
> memory issue for me.

Linux, 1100 empty threads (just thread::create and nothing more), top
reports 12.6g of virtual memory used.

That works out to about 12mb per empty thread.

Naturally if they are doing something they will each be larger.

Re: limit on threads?

<87a5v8p87t.fsf@joerg-mertens.dialin.t-online.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22511&group=comp.lang.tcl#22511

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: joerg-mertens@t-online.de (Joerg Mertens)
Newsgroups: comp.lang.tcl
Subject: Re: limit on threads?
Date: Thu, 03 Aug 2023 15:27:02 +0200
Organization: privat
Lines: 12
Message-ID: <87a5v8p87t.fsf@joerg-mertens.dialin.t-online.de>
References: <uaeisa$9s96$1@dont-email.me> <uael5t$a82n$1@dont-email.me>
<uaeqha$aogv$1@dont-email.me> <uaf0u2$felr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="0bbee52946c93c8381745484b8af87f6";
logging-data="833101"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T4O4ww1eb6AB8NT5JrV443cQLL3sSn38="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix)
Cancel-Lock: sha1:KkZnczhlTE7OSJcSdZl53C38dUo=
sha1:N57kE51Kg4M5KJCMsUoSlG8G1IY=
 by: Joerg Mertens - Thu, 3 Aug 2023 13:27 UTC

Rich <rich@example.invalid> writes:

> Linux, 1100 empty threads (just thread::create and nothing more), top
> reports 12.6g of virtual memory used.
>
> That works out to about 12mb per empty thread.

This seems like a lot, so I tested it with an interactive tclsh. After
loading the thread package top shows 5560k. Each thread::create adds
about 1000k. Do you have some other packages loaded in your program?

Joerg

Re: limit on threads?

<uagdjm$pqf3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22512&group=comp.lang.tcl#22512

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: limit on threads?
Date: Thu, 3 Aug 2023 14:29:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <uagdjm$pqf3$1@dont-email.me>
References: <uaeisa$9s96$1@dont-email.me> <uael5t$a82n$1@dont-email.me> <uaeqha$aogv$1@dont-email.me> <uaf0u2$felr$1@dont-email.me> <87a5v8p87t.fsf@joerg-mertens.dialin.t-online.de>
Injection-Date: Thu, 3 Aug 2023 14:29:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5d0f5bfc520c987397bee0084a4754ac";
logging-data="846307"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Jl8Wl4/mk1I83r18Sfq65"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:auHTQtcg4AOEIuEMJKt15+qtaWs=
 by: Rich - Thu, 3 Aug 2023 14:29 UTC

Joerg Mertens <joerg-mertens@t-online.de> wrote:
> Rich <rich@example.invalid> writes:
>
>> Linux, 1100 empty threads (just thread::create and nothing more), top
>> reports 12.6g of virtual memory used.
>>
>> That works out to about 12mb per empty thread.
>
> This seems like a lot, so I tested it with an interactive tclsh. After
> loading the thread package top shows 5560k. Each thread::create adds
> about 1000k. Do you have some other packages loaded in your program?
>
> Joerg

Just a blank interactive tclsh (64 bit).

$ rlwrap tclsh
% package require Thread
2.8.7
% for {set i 0} {$i < 1000} {incr i} {thread::create}
%

And top reports, for the tclsh:

PID NI VIRT RES SWAP S %CPU %MEM TIME+ COMMAND
30010 0 11.8g 273760 0 S 0.0 1.1 0:02.84 tclsh

Only 273760 resident, but tclsh has allocaated 11.8g.

Just a blank tclsh (launched within rlwrap) shows as:

31029 0 6864 4636 0 R 0.0 0.0 0:13.47 tclsh

269k resident per thread -- but the virtual space itself balloons much
more.

Re: limit on threads?

<871qgkp25l.fsf@joerg-mertens.dialin.t-online.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22513&group=comp.lang.tcl#22513

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: joerg-mertens@t-online.de (Joerg Mertens)
Newsgroups: comp.lang.tcl
Subject: Re: limit on threads?
Date: Thu, 03 Aug 2023 17:37:58 +0200
Organization: privat
Lines: 54
Message-ID: <871qgkp25l.fsf@joerg-mertens.dialin.t-online.de>
References: <uaeisa$9s96$1@dont-email.me> <uael5t$a82n$1@dont-email.me>
<uaeqha$aogv$1@dont-email.me> <uaf0u2$felr$1@dont-email.me>
<87a5v8p87t.fsf@joerg-mertens.dialin.t-online.de>
<uagdjm$pqf3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="0bbee52946c93c8381745484b8af87f6";
logging-data="871112"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+c9Rzwy7I3gufaDknmPsxnvvGLUjeCXhM="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (berkeley-unix)
Cancel-Lock: sha1:6RLQgPSTFtNzNSb/hLSTbUqm0hg=
sha1:d8iSB6HJGI1Pdeuw82h886yTABE=
 by: Joerg Mertens - Thu, 3 Aug 2023 15:37 UTC

Rich <rich@example.invalid> writes:

> Joerg Mertens <joerg-mertens@t-online.de> wrote:
>> Rich <rich@example.invalid> writes:
>>
>>> Linux, 1100 empty threads (just thread::create and nothing more), top
>>> reports 12.6g of virtual memory used.
>>>
>>> That works out to about 12mb per empty thread.
>>
>> This seems like a lot, so I tested it with an interactive tclsh. After
>> loading the thread package top shows 5560k. Each thread::create adds
>> about 1000k. Do you have some other packages loaded in your program?
>>
>> Joerg

I didn't take into account that I did the test on OpenBSD. I also
wouldn't have thought the difference in memory management is so big.

> Just a blank interactive tclsh (64 bit).
>
> $ rlwrap tclsh
> % package require Thread
> 2.8.7
> % for {set i 0} {$i < 1000} {incr i} {thread::create}
> %

Same here, except the Thread package version is 2.8.8

> And top reports, for the tclsh:
>
> PID NI VIRT RES SWAP S %CPU %MEM TIME+ COMMAND
> 30010 0 11.8g 273760 0 S 0.0 1.1 0:02.84 tclsh
>
> Only 273760 resident, but tclsh has allocaated 11.8g.

My top output:

PID PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND
98511 3 0 966M 475M idle ttyin 0:05 0.00% tclsh8.6

SIZE is the total size of the process here. Should be similar to
linux's VIRT column.

> Just a blank tclsh (launched within rlwrap) shows as:
>
> 31029 0 6864 4636 0 R 0.0 0.0 0:13.47 tclsh
>
> 269k resident per thread -- but the virtual space itself balloons much
> more.

Yes, that's the main difference.

Joerg


devel / comp.lang.tcl / limit on threads?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor