Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #92556 > unrolled thread
| Started by | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| First post | 2023-10-11 05:30 +0200 |
| Last post | 2023-10-25 23:12 -0700 |
| Articles | 14 on this page of 134 — 12 participants |
Back to article view | Back to comp.lang.c++
What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-11 05:30 +0200
Re: What does this code print ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-11 14:03 +0100
Re: What does this code print ? gazelle@shell.xmission.com (Kenny McCormack) - 2023-10-11 13:12 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-11 19:22 +0200
Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-11 17:41 +0000
Re: What does this code print ? Bo Persson <bo@bo-persson.se> - 2023-10-11 20:24 +0200
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-13 05:24 +0200
Re: What does this code print ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-10-13 17:53 +0100
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:50 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-13 12:12 -0400
Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-13 17:27 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:52 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-14 11:26 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:08 +0200
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-15 12:55 -0700
Re: What does this code print ? Richard Damon <news.x.richarddamon@xoxy.net> - 2023-10-15 22:19 -0400
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-18 20:58 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-11 19:21 +0200
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-11 12:41 -0700
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-11 12:43 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-13 05:25 +0200
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-12 20:50 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-13 08:50 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-13 12:15 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:53 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-14 11:26 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:00 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:15 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:47 +0200
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-17 11:34 -0700
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-13 16:34 +0000
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-13 13:12 -0700
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-14 02:36 +0000
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-13 20:44 -0700
Re: What does this code print ? Paavo Helde <eesnimi@osa.pri.ee> - 2023-10-14 11:51 +0300
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-17 11:35 -0700
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-17 20:06 +0000
Re: What does this code print ? Paavo Helde <eesnimi@osa.pri.ee> - 2023-10-18 11:43 +0300
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-18 17:29 +0000
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-18 11:31 -0700
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-19 14:43 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-14 15:54 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-14 18:05 +0000
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-14 14:58 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 08:58 +0200
Re: What does this code print ? Richard Damon <news.x.richarddamon@xoxy.net> - 2023-10-14 12:47 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:07 +0200
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:12 +0200
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 09:16 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:35 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:48 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-17 23:04 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 19:58 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-19 14:39 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 19:58 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-19 18:06 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 20:11 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-19 19:20 +0000
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-19 16:06 -0400
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-19 14:45 -0700
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-19 23:26 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 09:19 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-20 05:47 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 17:59 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-20 19:16 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 08:02 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 08:38 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 19:40 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 10:54 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 20:34 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 12:45 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-22 04:18 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-21 19:28 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-22 06:53 +0200
Re: What does this code print ? Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-10-22 09:59 +0000
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-22 07:12 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-23 19:05 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-23 10:40 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 16:03 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 07:28 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 17:01 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 08:28 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 18:27 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 10:05 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 19:08 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 10:39 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 20:25 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-24 19:48 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 10:54 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 08:43 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 17:57 +0200
Re: What does this code print ? Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-10-24 16:40 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 19:07 +0200
Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-24 15:25 +0000
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-24 08:34 -0700
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-24 16:34 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-24 19:05 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-20 14:50 +0000
Re: What does this code print ? Bo Persson <bo@bo-persson.se> - 2023-10-20 17:34 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-20 15:59 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 18:00 +0200
Re: What does this code print ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-10-20 16:06 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-20 18:40 +0200
Re: What does this code print ? gazelle@shell.xmission.com (Kenny McCormack) - 2023-10-20 20:07 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-21 08:04 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:35 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:50 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-17 23:08 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 20:02 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-19 14:43 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-19 20:02 +0200
Re: What does this code print ? scott@slp53.sl.home (Scott Lurndal) - 2023-10-15 14:36 +0000
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-15 18:15 +0200
Re: What does this code print ? Richard Damon <news.x.richarddamon@xoxy.net> - 2023-10-15 22:23 -0400
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-17 07:51 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-17 23:08 -0400
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-15 13:25 -0400
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-14 11:33 -0700
Re: What does this code print ? Paavo Helde <eesnimi@osa.pri.ee> - 2023-10-14 21:54 +0300
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-14 11:56 -0700
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-24 15:53 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 15:07 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 08:43 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 18:01 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 09:21 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-25 18:24 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 11:23 -0700
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-25 15:02 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-26 07:13 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 23:09 -0700
Re: What does this code print ? James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-10-25 23:55 -0400
Re: What does this code print ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-25 15:01 -0700
Re: What does this code print ? Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-26 07:15 +0200
Re: What does this code print ? Richard Damon <richard@damon-family.org> - 2023-10-25 23:12 -0700
Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2023-10-24 15:53 -0700 |
| Message-ID | <uh9hti$84mf$1@dont-email.me> |
| In reply to | #92834 |
On 10/14/2023 11:54 AM, Paavo Helde wrote:
> 14.10.2023 21:33 Chris M. Thomasson kirjutas:
>> On 10/12/2023 11:50 PM, Bonita Montero wrote:
>>> Am 13.10.2023 um 05:50 schrieb Chris M. Thomasson:
>>>> On 10/11/2023 6:03 AM, Ben Bacarisse wrote:
>>>>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>>>>
>>>>>> #include <iostream>
>>>>>>
>>>>>> using namespace std;
>>>>>>
>>>>>> int main()
>>>>>> {
>>>>>> auto lambda = []( int a ) -> int
>>>>>> {
>>>>>> thread_local int i = 0;
>>>>>> return i++ + a;
>>>>>> };
>>>>>> int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>>>>>> int (__stdcall *volatile pFnStdcall)( int ) = lambda;
>>>>>> cout << pFnFastcall( 10 ) << endl;
>>>>>> cout << pFnStdcall( 9 ) << endl;
>>>>>> }
>>
>> 10 10 is a hint...
>
> I also got 10 10, first in my head, and my compiler agreed as well
> (VS2022).
Not sure what the point of Bonita's post was. thread_local is going to
the thread calling main here. All of the rest is just moronic fluff.
10
10
is correct.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-10-25 15:07 +0200 |
| Message-ID | <uhb3ud$p19b$1@dont-email.me> |
| In reply to | #95257 |
Am 25.10.2023 um 00:53 schrieb Chris M. Thomasson: > Not sure what the point of Bonita's post was. thread_local is going to > the thread calling main here. All of the rest is just moronic fluff. Someone might expect that the thread_local or static variables are not shared among the differernt instantiations of the calling operator as with a generic calling operator.
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <richard@damon-family.org> |
|---|---|
| Date | 2023-10-25 08:43 -0700 |
| Message-ID | <uhbd3m$2mvvu$3@i2pn2.org> |
| In reply to | #95774 |
On 10/25/23 6:07 AM, Bonita Montero wrote: > Am 25.10.2023 um 00:53 schrieb Chris M. Thomasson: > >> Not sure what the point of Bonita's post was. thread_local is going to >> the thread calling main here. All of the rest is just moronic fluff. > > Someone might expect that the thread_local or static variables > are not shared among the differernt instantiations of the calling > operator as with a generic calling operator. > > Maybe, but they would be wrong. After all, for a "generic" lambda, each variation is really a different function (just like a template function), but each instance of a GIVEN instance of the "generic" lambda, just like the non-generic lambda, or even an ordinary function, when inlined MUST share static or thread_local variables.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-10-25 18:01 +0200 |
| Message-ID | <uhbe4o$rqvq$2@dont-email.me> |
| In reply to | #95822 |
Am 25.10.2023 um 17:43 schrieb Richard Damon: > After all, for a "generic" lambda, each variation is really a different > function (just like a template function), but each instance of a GIVEN > instance of the "generic" lambda, just like the non-generic lambda, or > even an ordinary function, when inlined MUST share static or > thread_local variables. I would also have thought it acceptable if each "instance" of the lambda had its own static and thread-local variables for each calling convention. In practice, it would be very atypical if you actually instantiate the lambda with several calling conventions.
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <richard@damon-family.org> |
|---|---|
| Date | 2023-10-25 09:21 -0700 |
| Message-ID | <uhbfam$2mvvu$4@i2pn2.org> |
| In reply to | #95824 |
On 10/25/23 9:01 AM, Bonita Montero wrote: > Am 25.10.2023 um 17:43 schrieb Richard Damon: > >> After all, for a "generic" lambda, each variation is really a >> different function (just like a template function), but each instance >> of a GIVEN instance of the "generic" lambda, just like the non-generic >> lambda, or even an ordinary function, when inlined MUST share static >> or thread_local variables. > > I would also have thought it acceptable if each "instance" of > the lambda had its own static and thread-local variables for > each calling convention. In practice, it would be very atypical > if you actually instantiate the lambda with several calling > conventions. The key point is that for functions that are inlined, each inlined "instance" of the function doesn't get new shared static/thread-local variables. This is REQUIRED as inlining isn't allowed to change the visible behavior of the function, but is just an optimization. Your multiple "instances" are all logically part of the same function. Your thought process that you have two different versions of the lambda with different calling conventions is just incorrect. You have one version of the lambda, with the cdecl calling convention (since no convention was specified) used in both "instances". Each instance is actually an invoker/trampoline function with the specified calling convention, using the one defined lambda function, which happens to get inlined. So, perhaps at first glance it looks like there are two different version of the lambda function, but by the definitions of the Standard, there is one version, that has been inlined in two places within two different calling convention adaptor functions.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-10-25 18:24 +0200 |
| Message-ID | <uhbff9$s99h$1@dont-email.me> |
| In reply to | #95827 |
Am 25.10.2023 um 18:21 schrieb Richard Damon: > The key point is that for functions that are inlined, each inlined > "instance" of the function doesn't get new shared static/thread-local > variables. This is REQUIRED as inlining isn't allowed to change the > visible behavior of the function, but is just an optimization. We don't discuss standard issues.
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <richard@damon-family.org> |
|---|---|
| Date | 2023-10-25 11:23 -0700 |
| Message-ID | <uhbmfr$2mvvu$5@i2pn2.org> |
| In reply to | #95829 |
On 10/25/23 9:24 AM, Bonita Montero wrote: > Am 25.10.2023 um 18:21 schrieb Richard Damon: > >> The key point is that for functions that are inlined, each inlined >> "instance" of the function doesn't get new shared static/thread-local >> variables. This is REQUIRED as inlining isn't allowed to change the >> visible behavior of the function, but is just an optimization. > > We don't discuss standard issues. Maybe you don't, but the topic space of this newsgroup is "standard" C++.
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2023-10-25 15:02 -0700 |
| Message-ID | <uhc3a0$127ka$1@dont-email.me> |
| In reply to | #95876 |
On 10/25/2023 11:23 AM, Richard Damon wrote: > On 10/25/23 9:24 AM, Bonita Montero wrote: >> Am 25.10.2023 um 18:21 schrieb Richard Damon: >> >>> The key point is that for functions that are inlined, each inlined >>> "instance" of the function doesn't get new shared static/thread-local >>> variables. This is REQUIRED as inlining isn't allowed to change the >>> visible behavior of the function, but is just an optimization. >> >> We don't discuss standard issues. > > Maybe you don't, but the topic space of this newsgroup is "standard" C++. Bonita is radically confused here. Shit happens. ;^o
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-10-26 07:13 +0200 |
| Message-ID | <uhcsi0$1c932$1@dont-email.me> |
| In reply to | #95876 |
Am 25.10.2023 um 20:23 schrieb Richard Damon: > On 10/25/23 9:24 AM, Bonita Montero wrote: >> Am 25.10.2023 um 18:21 schrieb Richard Damon: >> >>> The key point is that for functions that are inlined, each inlined >>> "instance" of the function doesn't get new shared static/thread-local >>> variables. This is REQUIRED as inlining isn't allowed to change the >>> visible behavior of the function, but is just an optimization. >> >> We don't discuss standard issues. > > Maybe you don't, but the topic space of this newsgroup is "standard" C++. I started a platform-specific topic and you continued to reason why it is implemented as it is with standard-specific reasoning.
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <richard@damon-family.org> |
|---|---|
| Date | 2023-10-25 23:09 -0700 |
| Message-ID | <uhcvqp$2qfg0$6@i2pn2.org> |
| In reply to | #96098 |
On 10/25/23 10:13 PM, Bonita Montero wrote: > Am 25.10.2023 um 20:23 schrieb Richard Damon: >> On 10/25/23 9:24 AM, Bonita Montero wrote: >>> Am 25.10.2023 um 18:21 schrieb Richard Damon: >>> >>>> The key point is that for functions that are inlined, each inlined >>>> "instance" of the function doesn't get new shared >>>> static/thread-local variables. This is REQUIRED as inlining isn't >>>> allowed to change the visible behavior of the function, but is just >>>> an optimization. >>> >>> We don't discuss standard issues. >> >> Maybe you don't, but the topic space of this newsgroup is "standard" C++. > > I started a platform-specific topic and you continued to reason > why it is implemented as it is with standard-specific reasoning. No, you started a topic asking what some code did in a newsgroup for GENERAL C++ discussion that should have been done in a platform specific group. This was pointed out in the beginning. THe Standard still applies to the question, as we are discussing parts of the behavior that is actually specified by the standard, and the platforms conform to those parts of the standard, even in there extension that you were using, You just don't understand how the Language works.
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@alumni.caltech.edu> |
|---|---|
| Date | 2023-10-25 23:55 -0400 |
| Message-ID | <uhcnuu$1b5bu$1@dont-email.me> |
| In reply to | #95829 |
On 10/25/23 9:24 AM, Bonita Montero wrote: ... > We don't discuss standard issues. Correct, that's the domain of comp.std.c++. This group is for discussing the language defined by that standard, nor for discussing the standard itself.
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2023-10-25 15:01 -0700 |
| Message-ID | <uhc37n$11sgp$3@dont-email.me> |
| In reply to | #95824 |
On 10/25/2023 9:01 AM, Bonita Montero wrote: > Am 25.10.2023 um 17:43 schrieb Richard Damon: > >> After all, for a "generic" lambda, each variation is really a >> different function (just like a template function), but each instance >> of a GIVEN instance of the "generic" lambda, just like the non-generic >> lambda, or even an ordinary function, when inlined MUST share static >> or thread_local variables. > > I would also have thought it acceptable if each "instance" of > the lambda had its own static and thread-local variables for > each calling convention. In practice, it would be very atypical > if you actually instantiate the lambda with several calling > conventions. Humm... This means you do not understand thread_local at all. Study up! In this case it is working with the thread calling main. Your "fluff" does not matter one bit.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-10-26 07:15 +0200 |
| Message-ID | <uhcskp$1c932$2@dont-email.me> |
| In reply to | #95988 |
Am 26.10.2023 um 00:01 schrieb Chris M. Thomasson: > Humm... This means you do not understand thread_local at all. I wanted to say that it would be acceptable if MSVC would have implemented as if the funtions would be separated, just as if I'd have a generic calling operator.
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <richard@damon-family.org> |
|---|---|
| Date | 2023-10-25 23:12 -0700 |
| Message-ID | <uhd00u$2qfg0$7@i2pn2.org> |
| In reply to | #96100 |
On 10/25/23 10:15 PM, Bonita Montero wrote: > Am 26.10.2023 um 00:01 schrieb Chris M. Thomasson: > >> Humm... This means you do not understand thread_local at all. > > I wanted to say that it would be acceptable if MSVC would have > implemented as if the funtions would be separated, just as if > I'd have a generic calling operator. > Nope, it would have violated the standard. a generic lambda can only overload its definitions on what a function is allowed to be overloaded on. This is only the types of the parameters. Calling convention is NOT this, and is not eligable for overloading, in part because you can not tell in general which of the overloads by calling convention to use when you see the call, just as you can't overload by return type. It just isn't allowed. PERIOD. Thus MSVC would have been more non-conforming to support that behavior, so they don't.
[toc] | [prev] | [standalone]
Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]
Back to top | Article view | comp.lang.c++
csiph-web