Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Faith: not *wanting* to know what is true." -- Friedrich Nietzsche


devel / comp.lang.c++ / Re: Program with 3 threads mysteriously has 8 threads

SubjectAuthor
* Program with 3 threads mysteriously has 8 threadsFrederick Virchanza Gotham
+* Re: Program with 3 threads mysteriously has 8 threadsChris M. Thomasson
|`* Re: Program with 3 threads mysteriously has 8 threadsFrederick Virchanza Gotham
| `- Re: Program with 3 threads mysteriously has 8 threadsChristian Gollwitzer
+* Re: Program with 3 threads mysteriously has 8 threadsPavel
|`- Re: Program with 3 threads mysteriously has 8 threadsChris M. Thomasson
+- Re: Program with 3 threads mysteriously has 8 threadsMike Terry
`* Re: Program with 3 threads mysteriously has 8 threadsScott Lurndal
 `- Re: Program with 3 threads mysteriously has 8 threadsMuttley

1
Program with 3 threads mysteriously has 8 threads

<c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=332&group=comp.lang.c%2B%2B#332

  copy link   Newsgroups: comp.lang.c++
X-Received: by 2002:ac8:5846:0:b0:3f6:bb7b:b93e with SMTP id h6-20020ac85846000000b003f6bb7bb93emr2523244qth.4.1686518166210;
Sun, 11 Jun 2023 14:16:06 -0700 (PDT)
X-Received: by 2002:a05:622a:1a10:b0:3f6:a22f:a99c with SMTP id
f16-20020a05622a1a1000b003f6a22fa99cmr2498657qtb.6.1686518166016; Sun, 11 Jun
2023 14:16:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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.c++
Date: Sun, 11 Jun 2023 14:16:05 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=92.40.216.85; posting-account=w4UqJAoAAAAYC-PItfDbDoVGcg0yISyA
NNTP-Posting-Host: 92.40.216.85
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
Subject: Program with 3 threads mysteriously has 8 threads
From: cauldwell.thomas@gmail.com (Frederick Virchanza Gotham)
Injection-Date: Sun, 11 Jun 2023 21:16:06 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1621
 by: Frederick Virchanza - Sun, 11 Jun 2023 21:16 UTC

I'm writing a complex program at the moment and I want it to be absolutely bulletproof, so I'm using tools to find all memory leaks, all data races, etc. Mostly I'm using "-fsanitize" with g++.

My program has the main GUI thread, the Listener thread for reading from the network card, and the Sender thread for sending packets out on the network card. So that's three threads.

Sometimes my program shows as many as 8 threads. I don't know where these other 5 threads are being spawned nor what they're doing.

How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.

Re: Program with 3 threads mysteriously has 8 threads

<u65dse$2qdgf$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=333&group=comp.lang.c%2B%2B#333

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Program with 3 threads mysteriously has 8 threads
Date: Sun, 11 Jun 2023 14:21:18 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <u65dse$2qdgf$1@dont-email.me>
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 11 Jun 2023 21:21:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="47394bea606542304421c5049cade3e6";
logging-data="2962959"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PsRxV8gBmzkLCs6GXBlgYFqYlQaN9z24="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:WLfPk2QR7P/o39Ums7HblGgh+SA=
Content-Language: en-US
In-Reply-To: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
 by: Chris M. Thomasson - Sun, 11 Jun 2023 21:21 UTC

On 6/11/2023 2:16 PM, Frederick Virchanza Gotham wrote:
>
> I'm writing a complex program at the moment and I want it to be absolutely bulletproof, so I'm using tools to find all memory leaks, all data races, etc. Mostly I'm using "-fsanitize" with g++.
>
> My program has the main GUI thread, the Listener thread for reading from the network card, and the Sender thread for sending packets out on the network card. So that's three threads.
>
> Sometimes my program shows as many as 8 threads. I don't know where these other 5 threads are being spawned nor what they're doing.
>
> How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.

Not sure. Perhaps the sanitizer creates some extra threads? Create your
program in a release build with all sanitize stuff turned off.

The main thread runs your GUI loop, right?

Re: Program with 3 threads mysteriously has 8 threads

<u6rhM.41298$hl93.14234@fx18.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=334&group=comp.lang.c%2B%2B#334

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
Subject: Re: Program with 3 threads mysteriously has 8 threads
Newsgroups: comp.lang.c++
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
From: pauldontspamtolk@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.15
MIME-Version: 1.0
In-Reply-To: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 18
Message-ID: <u6rhM.41298$hl93.14234@fx18.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sun, 11 Jun 2023 21:35:22 UTC
Date: Sun, 11 Jun 2023 17:35:12 -0400
X-Received-Bytes: 1704
 by: Pavel - Sun, 11 Jun 2023 21:35 UTC

Frederick Virchanza Gotham wrote:
>
> I'm writing a complex program at the moment and I want it to be absolutely bulletproof, so I'm using tools to find all memory leaks, all data races, etc. Mostly I'm using "-fsanitize" with g++.
>
> My program has the main GUI thread, the Listener thread for reading from the network card, and the Sender thread for sending packets out on the network card. So that's three threads.
>
> Sometimes my program shows as many as 8 threads. I don't know where these other 5 threads are being spawned nor what they're doing.
>
> How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.
>
You might want to try running your program under "strace".

Then you could try to correlate strace output for the system calls
creating the threas with log output and other system calls shown by
strace to figure out at what points the mysterious threads are created.

HTH
-Pavel

Re: Program with 3 threads mysteriously has 8 threads

<8eda38fd-06c7-4bee-8fff-5692c171ac8en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=335&group=comp.lang.c%2B%2B#335

  copy link   Newsgroups: comp.lang.c++
X-Received: by 2002:ac8:5743:0:b0:3f6:a97d:1548 with SMTP id 3-20020ac85743000000b003f6a97d1548mr2360447qtx.8.1686519501397;
Sun, 11 Jun 2023 14:38:21 -0700 (PDT)
X-Received: by 2002:ac8:7e95:0:b0:3f6:ae6d:6c3d with SMTP id
w21-20020ac87e95000000b003f6ae6d6c3dmr2191591qtj.12.1686519501223; Sun, 11
Jun 2023 14:38:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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.c++
Date: Sun, 11 Jun 2023 14:38:20 -0700 (PDT)
In-Reply-To: <u65dse$2qdgf$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=92.40.216.85; posting-account=w4UqJAoAAAAYC-PItfDbDoVGcg0yISyA
NNTP-Posting-Host: 92.40.216.85
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com> <u65dse$2qdgf$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8eda38fd-06c7-4bee-8fff-5692c171ac8en@googlegroups.com>
Subject: Re: Program with 3 threads mysteriously has 8 threads
From: cauldwell.thomas@gmail.com (Frederick Virchanza Gotham)
Injection-Date: Sun, 11 Jun 2023 21:38:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3710
 by: Frederick Virchanza - Sun, 11 Jun 2023 21:38 UTC

On Sunday, June 11, 2023 at 10:21:36 PM UTC+1, Chris M. Thomasson wrote:
>>
> > How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.
> Not sure. Perhaps the sanitizer creates some extra threads? Create your
> program in a release build with all sanitize stuff turned off.
>
> The main thread runs your GUI loop, right?

Just now I made a build with "-O3 -DNDEBUG", without all the address sanitizer stuff. It has 7 threads.

The main thread is managed by the wxWidgets library, it's the GUI thread. Two threads are spawned by my own code. I don't know where the other 4 have come from.

Ideally I'd like to be able to run it in a debugger and issue a command something like "find thread starts", and to have it come back with something like:

Thread 1 started in GUI_Dialog_Main.cpp on Line 57
Thread 2 started in common_callers.c on Line 89
Thread 3 started in main.cpp on Line 12
Thread 4 started inside shared library libWhatever.so

Actually just now inside the GDB debugger, I issued the command "info threads" and I got back:

(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7ffff5e1ba80 (LWP 115888) "dynamo" 0x00007ffff691112f in __GI___poll (fds=0x555556432170, nfds=3, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
2 Thread 0x7ffff57ff6c0 (LWP 115891) "gmain" 0x00007ffff691112f in __GI___poll (fds=0x555555d253a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
3 Thread 0x7ffff4ffe6c0 (LWP 115892) "pool-dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
4 Thread 0x7fffeffff6c0 (LWP 115893) "gdbus" 0x00007ffff691112f in __GI___poll (fds=0x7fffe800ffa0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
5 Thread 0x7fffef7fe6c0 (LWP 115894) "dconf worker" 0x00007ffff691112f in __GI___poll (fds=0x555555d3e750, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
6 Thread 0x7fffee86e6c0 (LWP 115895) "dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
7 Thread 0x7fffee06d6c0 (LWP 115896) "dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38

I tried issuing the command "thread apply all bt" but I'm not sure about what it comes back with -- it seems like some of the threads might be spawned inside libglib.

Re: Program with 3 threads mysteriously has 8 threads

<u65esp$2qgvl$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=336&group=comp.lang.c%2B%2B#336

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Program with 3 threads mysteriously has 8 threads
Date: Sun, 11 Jun 2023 14:38:33 -0700
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <u65esp$2qgvl$1@dont-email.me>
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
<u6rhM.41298$hl93.14234@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 11 Jun 2023 21:38:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="47394bea606542304421c5049cade3e6";
logging-data="2966517"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QkYr+2tpxVunEUyCQwgkYGR8Y9pOA6Cg="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:vI6CHs/cfQmDVPYmDXlfNT0TKvo=
In-Reply-To: <u6rhM.41298$hl93.14234@fx18.iad>
Content-Language: en-US
 by: Chris M. Thomasson - Sun, 11 Jun 2023 21:38 UTC

On 6/11/2023 2:35 PM, Pavel wrote:
> Frederick Virchanza Gotham wrote:
>>
>> I'm writing a complex program at the moment and I want it to be
>> absolutely bulletproof, so I'm using tools to find all memory leaks,
>> all data races, etc. Mostly I'm using "-fsanitize" with g++.
>>
>> My program has the main GUI thread, the Listener thread for reading
>> from the network card, and the Sender thread for sending packets out
>> on the network card. So that's three threads.
>>
>> Sometimes my program shows as many as 8 threads. I don't know where
>> these other 5 threads are being spawned nor what they're doing.
>>
>> How would you go about figuring this out? I'm using the latest Ubuntu
>> Linux on x86_64.
>>
> You might want to try running your program under "strace".
>
> Then you could try to correlate strace output for the system calls
> creating the threas with log output and other system calls shown by
> strace to figure out at what points the mysterious threads are created.

Yeah. Wondering if he is using a third party lib? Sometimes they can
create some threads...

Re: Program with 3 threads mysteriously has 8 threads

<L-6dnS4gn8Jezhv5nZ2dnZfqn_udnZ2d@brightview.co.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=337&group=comp.lang.c%2B%2B#337

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!69.80.99.22.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 11 Jun 2023 23:07:47 +0000
Subject: Re: Program with 3 threads mysteriously has 8 threads
Newsgroups: comp.lang.c++
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
From: news.dead.person.stones@darjeeling.plus.com (Mike Terry)
Date: Mon, 12 Jun 2023 00:07:47 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.13
MIME-Version: 1.0
In-Reply-To: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <L-6dnS4gn8Jezhv5nZ2dnZfqn_udnZ2d@brightview.co.uk>
Lines: 36
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-1XGqY6xpaYkvfKEiwZtn3q5hRlJZ58f97ttBxADvp9m9eYX37z3V5SfEoB7Erx9zDp3a3AOGrryb81o!yGn0jCCyOwAv0p0Y5gZKRbwckaSjvxcplx6cx1u+d6yEbJ3VhlYAcFHjP1abF3CiZXOeueMHurp/!9S/Wy1hE8crpOq3tqhOWtzUgZz4=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 3494
 by: Mike Terry - Sun, 11 Jun 2023 23:07 UTC

On 11/06/2023 22:16, Frederick Virchanza Gotham wrote:
>
> I'm writing a complex program at the moment and I want it to be absolutely bulletproof, so I'm using tools to find all memory leaks, all data races, etc. Mostly I'm using "-fsanitize" with g++.
>
> My program has the main GUI thread, the Listener thread for reading from the network card, and the Sender thread for sending packets out on the network card. So that's three threads.
>
> Sometimes my program shows as many as 8 threads. I don't know where these other 5 threads are being spawned nor what they're doing.
>
> How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.
>

On a Windows system, I would:

a) run under a debugger and look at stack traces for the extra threads after breaking at some point
after the threads have appeared. This should reveal what the thread was created to achieve, i.e.
looking at the deepest entries before you get to the base OS thread startup routines. Also, simply
what the threads are currently doing might give some clues... (this is too late to reveal exactly
where the threads were created)

b) if curiosity is not satisfied, I'd set a breakpoint at the create thread OS API at the start of
the program, and see where the breakpoint is hit.

c) Umm, for Windows there are logging tools that would trace various OS calls including the
cretaion/termination of threads. Such a tool might be useful if Linux has one. (Perhaps inquire on
a Linux newsgroup.)

I assume there are equivalent debugging procedures for a Linux system. External libraries could be
creating and managing their own internal threads within your application, or maybe even the C++
library can create extra threads (or thread pools) for parallelising data related operations like
sorts or whatever?? [I can't say I've observed that myself, but I'm not too adventurous in that
respect.] Most likely it's something in a library you're using, and most developers aren't going to
worry too much over that, as they choose to concentrate on the correctness of their own code, which
is hard enough!

Mike.

Re: Program with 3 threads mysteriously has 8 threads

<u66abf$30q3u$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=338&group=comp.lang.c%2B%2B#338

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.c++
Subject: Re: Program with 3 threads mysteriously has 8 threads
Date: Mon, 12 Jun 2023 07:27:11 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <u66abf$30q3u$1@dont-email.me>
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
<u65dse$2qdgf$1@dont-email.me>
<8eda38fd-06c7-4bee-8fff-5692c171ac8en@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 12 Jun 2023 05:27:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6c6b415258fe849802adbce4d050dbd9";
logging-data="3172478"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vvi6FQHctOn4OQmnHLlmbuhfHuc0BWQo="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.12.0
Cancel-Lock: sha1:9vB1H0DNB/9ljkqQ6IKUQpcAg8U=
In-Reply-To: <8eda38fd-06c7-4bee-8fff-5692c171ac8en@googlegroups.com>
 by: Christian Gollwitzer - Mon, 12 Jun 2023 05:27 UTC

Am 11.06.23 um 23:38 schrieb Frederick Virchanza Gotham:
>
> Actually just now inside the GDB debugger, I issued the command "info threads" and I got back:
>
> (gdb) info threads
> Id Target Id Frame
> * 1 Thread 0x7ffff5e1ba80 (LWP 115888) "dynamo" 0x00007ffff691112f in __GI___poll (fds=0x555556432170, nfds=3, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
> 2 Thread 0x7ffff57ff6c0 (LWP 115891) "gmain" 0x00007ffff691112f in __GI___poll (fds=0x555555d253a0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
> 3 Thread 0x7ffff4ffe6c0 (LWP 115892) "pool-dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
> 4 Thread 0x7fffeffff6c0 (LWP 115893) "gdbus" 0x00007ffff691112f in __GI___poll (fds=0x7fffe800ffa0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
> 5 Thread 0x7fffef7fe6c0 (LWP 115894) "dconf worker" 0x00007ffff691112f in __GI___poll (fds=0x555555d3e750, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
> 6 Thread 0x7fffee86e6c0 (LWP 115895) "dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
> 7 Thread 0x7fffee06d6c0 (LWP 115896) "dynamo" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
>
> I tried issuing the command "thread apply all bt" but I'm not sure about what it comes back with -- it seems like some of the threads might be spawned inside libglib.

I suspect that the "extra" threads are spawned by wxWidgets or GTK in
order to wait for specific events. It is not uncommon to do that in
order to integrate an event source into the main event loop. "gdbus",
e.g., is a library for interaction with the DBus process
intercommunication system.

Christian

Re: Program with 3 threads mysteriously has 8 threads

<IlGhM.10439$NuA9.1510@fx03.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=339&group=comp.lang.c%2B%2B#339

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Program with 3 threads mysteriously has 8 threads
Newsgroups: comp.lang.c++
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com>
Lines: 19
Message-ID: <IlGhM.10439$NuA9.1510@fx03.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 12 Jun 2023 14:55:36 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 12 Jun 2023 14:55:36 GMT
X-Received-Bytes: 1551
 by: Scott Lurndal - Mon, 12 Jun 2023 14:55 UTC

Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> writes:
>
>I'm writing a complex program at the moment and I want it to be absolutely bulletproof, so I'm using tools to find all memory leaks, all data races, etc. Mostly I'm using "-fsanitize" with g++.
>
>My program has the main GUI thread, the Listener thread for reading from the network card, and the Sender thread for sending packets out on the network card. So that's three threads.
>
>Sometimes my program shows as many as 8 threads. I don't know where these other 5 threads are
being spawned nor what they're doing?

What do you mean by "shows"? The ps(1) or top(1) commands or some internal
logic in your application?

>
>How would you go about figuring this out? I'm using the latest Ubuntu Linux on x86_64.

run the program under gdb and

(gdb) thread apply all bt

Re: Program with 3 threads mysteriously has 8 threads

<u6992o$3him4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=351&group=comp.lang.c%2B%2B#351

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.lang.c++
Subject: Re: Program with 3 threads mysteriously has 8 threads
Date: Tue, 13 Jun 2023 08:23:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <u6992o$3him4$1@dont-email.me>
References: <c5b6f7e9-7f7f-49ec-838f-d79579b1561fn@googlegroups.com> <IlGhM.10439$NuA9.1510@fx03.iad>
Injection-Date: Tue, 13 Jun 2023 08:23:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="428d3e607d9ac4ba996e572467bd6a7c";
logging-data="3721924"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18z/VP91JleBaqeKCgkRZHg"
Cancel-Lock: sha1:hxoQFeK8EYlA8ApA5BQVTnGyITY=
 by: Muttley@dastardlyhq.com - Tue, 13 Jun 2023 08:23 UTC

On Mon, 12 Jun 2023 14:55:36 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> writes:
>>
>>I'm writing a complex program at the moment and I want it to be absolutely
>bulletproof, so I'm using tools to find all memory leaks, all data races, etc.
>Mostly I'm using "-fsanitize" with g++.
>>
>>My program has the main GUI thread, the Listener thread for reading from the
>network card, and the Sender thread for sending packets out on the network
>card. So that's three threads.
>>
>>Sometimes my program shows as many as 8 threads. I don't know where these
>other 5 threads are
>being spawned nor what they're doing?
>
>What do you mean by "shows"? The ps(1) or top(1) commands or some internal
>logic in your application?
>
>>
>>How would you go about figuring this out? I'm using the latest Ubuntu Linux
>on x86_64.
>
>run the program under gdb and
>
>(gdb) thread apply all bt

Not come across that, useful.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor