Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

What hath Bob wrought?


devel / comp.lang.c / Re: Book or tutorial on standard C threads

SubjectAuthor
* Book or tutorial on standard C threadsMehdi Amini
+* Re: Book or tutorial on standard C threadsBonita Montero
|`* Re: Book or tutorial on standard C threadsKenny McCormack
| `- Re: Book or tutorial on standard C threadsBonita Montero
+* Re: Book or tutorial on standard C threadsThiago Adams
|`* Re: Book or tutorial on standard C threadsBonita Montero
| `* Re: Book or tutorial on standard C threadsScott Lurndal
|  `* Re: Book or tutorial on standard C threadsBonita Montero
|   +* Re: Book or tutorial on standard C threadsGuillaume
|   |`- Re: Book or tutorial on standard C threadsBonita Montero
|   `* Re: Book or tutorial on standard C threadsMalcolm McLean
|    `* Re: Book or tutorial on standard C threadsBonita Montero
|     `* Re: Book or tutorial on standard C threadsBart
|      +- Re: Book or tutorial on standard C threadsBonita Montero
|      +* Re: Book or tutorial on standard C threadsScott Lurndal
|      |+- Re: Book or tutorial on standard C threadsBonita Montero
|      |`- Re: Book or tutorial on standard C threadsChris M. Thomasson
|      `* Re: Book or tutorial on standard C threadsBonita Montero
|       +* Re: Book or tutorial on standard C threadsBonita Montero
|       |`* Re: Book or tutorial on standard C threadsBart
|       | +* Re: Book or tutorial on standard C threadsBonita Montero
|       | |`* Re: Book or tutorial on standard C threadsBart
|       | | +- Re: Book or tutorial on standard C threadsBen Bacarisse
|       | | `* Re: Book or tutorial on standard C threadsBonita Montero
|       | |  `* Re: Book or tutorial on standard C threadsBart
|       | |   `- Re: Book or tutorial on standard C threadsBonita Montero
|       | `* Re: Book or tutorial on standard C threadsDavid Brown
|       |  +* Re: Book or tutorial on standard C threadsBart
|       |  |+- Re: Book or tutorial on standard C threadsBonita Montero
|       |  |+* Re: Book or tutorial on standard C threadsDavid Brown
|       |  ||+* Re: Book or tutorial on standard C threadsÖö Tiib
|       |  |||+* Re: Book or tutorial on standard C threadsBonita Montero
|       |  ||||`- Re: Book or tutorial on standard C threadsÖö Tiib
|       |  |||`- Re: Book or tutorial on standard C threadsDavid Brown
|       |  ||`* Re: Book or tutorial on standard C threadsBart
|       |  || `- Re: Book or tutorial on standard C threadsDavid Brown
|       |  |`* Re: Book or tutorial on standard C threadsBen Bacarisse
|       |  | `* Re: Book or tutorial on standard C threadsBart
|       |  |  `* Re: Book or tutorial on standard C threadsBonita Montero
|       |  |   `* Re: Book or tutorial on standard C threadsÖö Tiib
|       |  |    +* Re: Book or tutorial on standard C threadsBonita Montero
|       |  |    |`* Re: Book or tutorial on standard C threadsÖö Tiib
|       |  |    | `- Re: Book or tutorial on standard C threadsBonita Montero
|       |  |    `* Re: Book or tutorial on standard C threadsBen Bacarisse
|       |  |     `* Re: Book or tutorial on standard C threadsÖö Tiib
|       |  |      `* Re: Book or tutorial on standard C threadsBart
|       |  |       +- Re: Book or tutorial on standard C threadsBonita Montero
|       |  |       `* Re: Book or tutorial on standard C threadsÖö Tiib
|       |  |        `* Re: Book or tutorial on standard C threadsMalcolm McLean
|       |  |         `- Re: Book or tutorial on standard C threadsÖö Tiib
|       |  `* Re: Book or tutorial on standard C threadsScott Lurndal
|       |   +- Re: Book or tutorial on standard C threadsDavid Brown
|       |   `- Re: Book or tutorial on standard C threadsBonita Montero
|       `* Re: Book or tutorial on standard C threadsBart
|        `* Re: Book or tutorial on standard C threadsBonita Montero
|         `* Re: Book or tutorial on standard C threadsScott Lurndal
|          `- Re: Book or tutorial on standard C threadsBonita Montero
+* Re: Book or tutorial on standard C threadsChris M. Thomasson
|`* Re: Book or tutorial on standard C threadsBen Bacarisse
| `* Re: Book or tutorial on standard C threadsChris M. Thomasson
|  `- Re: Book or tutorial on standard C threadsChris M. Thomasson
`* Re: Book or tutorial on standard C threadsChris M. Thomasson
 `- Re: Book or tutorial on standard C threadsBonita Montero

Pages:123
Re: Book or tutorial on standard C threads

<95ceeac2-58e2-4cfe-be9e-d86a42387c73n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19519&group=comp.lang.c#19519

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:5365:: with SMTP id e5mr6481491qvv.127.1639840355730;
Sat, 18 Dec 2021 07:12:35 -0800 (PST)
X-Received: by 2002:a05:622a:48e:: with SMTP id p14mr2578098qtx.553.1639840355610;
Sat, 18 Dec 2021 07:12:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.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.c
Date: Sat, 18 Dec 2021 07:12:35 -0800 (PST)
In-Reply-To: <spkrbh$i1h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=94.246.251.164; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 94.246.251.164
References: <sp1gtv$nht$1@dont-email.me> <c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me> <dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me> <spdfc4$1l6$1@dont-email.me>
<spenqd$t0c$1@dont-email.me> <spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk> <spggi3$k89$1@dont-email.me>
<spkl4g$9kd$1@dont-email.me> <66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<spkrbh$i1h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <95ceeac2-58e2-4cfe-be9e-d86a42387c73n@googlegroups.com>
Subject: Re: Book or tutorial on standard C threads
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Sat, 18 Dec 2021 15:12:35 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 36
 by: Öö Tiib - Sat, 18 Dec 2021 15:12 UTC

On Saturday, 18 December 2021 at 16:31:23 UTC+2, Bonita Montero wrote:
> > Lambdas are just syntax simplification of few things ...
>
> No, it's not "just" syntax-simplification, it's the ease of use
> to prevent a lot of redundant code and to write objects with only
> a calling operator in one line.

That is definition of the syntax sugar. No effects to result just different
way to type it in. There already was Boost.Bind template for generating
such classes and objects of such classes on same line ... for whatever
reason it was also added to C++11 as std::bind.

> > From syntax sugar improvements the range-based-for and variadic
> > templates are also far better than lambdas ...
>
> They're not comparable since they solve completely different
> purposes.

But you compared them first by saying that lambdas are most
important. Why you compared non-comparable thing?

> > because these make code more elegant without adding any weird
> > garbage or confusion.
> Lambdas are not confusing. But variadic templates can be very confusing.

Nonsense. Lambdas are often just copy paste bloat with garbled syntax
while variadic templates made lot of template code far shorter.
So snip and run with nonsense? Restoring:

# C++11 added several performance improvements like move semantics,
# constexpr, noexcept, split concepts of trivial classes and standard layout
# classes, even underlying type of enum. These are all better than syntax
# sugar because these help to have more efficient product.
# # Therefore only the optional cosmetic things like nullptr, final, override,
# enum class, explicit, etc. are less important than lambdas.

Re: Book or tutorial on standard C threads

<spkvmo$e87$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19526&group=comp.lang.c#19526

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Sat, 18 Dec 2021 16:45:28 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <spkvmo$e87$1@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me>
<c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me>
<dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me>
<spdfc4$1l6$1@dont-email.me> <spenqd$t0c$1@dont-email.me>
<spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk>
<spggi3$k89$1@dont-email.me> <spkl4g$9kd$1@dont-email.me>
<66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<spkrbh$i1h$1@dont-email.me>
<95ceeac2-58e2-4cfe-be9e-d86a42387c73n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 18 Dec 2021 15:45:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="39aec95fcf390d4e22123bfed9ade6cb";
logging-data="14599"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MJxreMRMKhK1GUh1z7ScrQH50Q1f3XTo="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:YTvyx3xlgcM0/X5oRfnARsBhmLg=
In-Reply-To: <95ceeac2-58e2-4cfe-be9e-d86a42387c73n@googlegroups.com>
Content-Language: de-DE
 by: Bonita Montero - Sat, 18 Dec 2021 15:45 UTC

Am 18.12.2021 um 16:12 schrieb Öö Tiib:

> That is definition of the syntax sugar. No effects to result just different.

Syntactic sugar is when there's no major improvement also. But here
the improvement is huge because you have to write much less code and
the code becomes much more readable-.

> There already was Boost.Bind template for generating
> such classes and objects of such classes on same line ...

The ease of C++ lambdas isn't substitutable.

> But you compared them first by saying that lambdas are most
> important. Why you compared non-comparable thing?

My comparison was from the standpoint of code-length and readability.

> Nonsense. Lambdas are often just copy paste bloat ...

Lambdas usually save a lot of redundant code and make the code much
more readable.

> ... with garbled syntax ...

The syntax is trivial.

> ... while variadic templates made lot of template code far shorter. ..

Variadic templates make templates not easier but make tmplated
things possible which weren't possible before. But they can be
tricky to use.

Re: Book or tutorial on standard C threads

<spl61k$mja$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19532&group=comp.lang.c#19532

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Sat, 18 Dec 2021 18:33:40 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <spl61k$mja$2@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me>
<c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me>
<dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me>
<spdfc4$1l6$1@dont-email.me> <spenqd$t0c$1@dont-email.me>
<spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <spg36r$2ok$1@dont-email.me>
<8daae9e6-5806-4798-98f9-dcdcf4815766n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 18 Dec 2021 17:33:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cda1128b60b8075ff749aba4d5123070";
logging-data="23146"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187uiQRk8k1NtQ78Y+15sAo+0K6R4GxrEM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:r5Rl9IAeCEJil591WABASecJZ8U=
In-Reply-To: <8daae9e6-5806-4798-98f9-dcdcf4815766n@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Sat, 18 Dec 2021 17:33 UTC

On 17/12/2021 18:30, Öö Tiib wrote:
> On Thursday, 16 December 2021 at 21:14:46 UTC+2, David Brown wrote:
>>
>> The simplest lambda is therefore: [](){}, and can be defined then
>> immediately called as [](){}(). C++ is a happy language with lots of
>> smilies!
>
> Yes. I've been surprised when some people say that it is oh so
> readable.
> Handy? Very. Happy? Perhaps. Readable? Hmm.
>

Obviously real uses of lambdas look different. Like pretty much any
feature of any programming language, they can be used well to improve
code and make it clearer, more maintainable, more readable, more
efficient - or they can be used poorly with worse results. (And "more
readable" is always subjective and context-dependent.)

Re: Book or tutorial on standard C threads

<spl6n7$uv9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19534&group=comp.lang.c#19534

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Sat, 18 Dec 2021 18:45:10 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <spl6n7$uv9$1@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me>
<c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me>
<dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me>
<spdfc4$1l6$1@dont-email.me> <spenqd$t0c$1@dont-email.me>
<spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <spg36r$2ok$1@dont-email.me>
<spikbg$djf$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 18 Dec 2021 17:45:11 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cda1128b60b8075ff749aba4d5123070";
logging-data="31721"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kLaOX3N9hxbDJxk+k+ldI/epc2FNCDsQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:GfahCBIfUtjHdOC8LjrbhpZYXB4=
In-Reply-To: <spikbg$djf$1@dont-email.me>
Content-Language: en-GB
 by: David Brown - Sat, 18 Dec 2021 17:45 UTC

On 17/12/2021 19:19, Bart wrote:
> On 16/12/2021 19:14, David Brown wrote:
>> On 16/12/2021 19:00, Bart wrote:
>
>>> So the lambda here is the local 'function' that includes that '[&]`
>>> (according to BB)?
>>
>> The syntax for a lambda in C++ is basically a "[]" bit that can include
>> captures (by value or reference) that replaces the function name in a
>> normal function definition.  And the return type is either deduced
>> automatically, or given with the newer "-> T" syntax rather than ahead
>> of the function name.
>>
>> The simplest lambda is therefore: [](){}, and can be defined then
>> immediately called as [](){}().  C++ is a happy language with lots of
>> smilies!
>
> I tried to add <> in there but it didn't work.
>

With C++20, you can add <> brackets to make a templated lambda.
Unfortunately, you need something inside the brackets. But if you want,
you can write:

[]<int...>(){}();

(In reality, lambdas can be useful in C++ just like in many other
languages. Don't let this silliness put you off them.)

Re: Book or tutorial on standard C threads

<87mtkxpjq9.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19543&group=comp.lang.c#19543

  copy link   Newsgroups: comp.lang.c
Followup: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Followup-To: comp.lang.c++
Date: Sat, 18 Dec 2021 23:38:06 +0000
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <87mtkxpjq9.fsf@bsb.me.uk>
References: <sp1gtv$nht$1@dont-email.me>
<c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me>
<dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me>
<spdfc4$1l6$1@dont-email.me> <spenqd$t0c$1@dont-email.me>
<spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk>
<spggi3$k89$1@dont-email.me> <spkl4g$9kd$1@dont-email.me>
<66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="c78496f45d3798f7f0289f5e03f05e14";
logging-data="27283"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18A2nBgHP0FVFfr9TW6V38aju+mDwj06Nc="
Cancel-Lock: sha1:v/nPPa0G1bk5p9eR9ZVee0HJ2WQ=
sha1:faXqlwbA+Omlz39rAKjM8BcTR3E=
X-BSB-Auth: 1.f8a8123fa08246528f0a.20211218233806GMT.87mtkxpjq9.fsf@bsb.me.uk
 by: Ben Bacarisse - Sat, 18 Dec 2021 23:38 UTC

Öö Tiib <ootiib@hot.ee> writes:

> Lambdas are just syntax simplification of few things

and later...

> C++11 added several performance improvements like move semantics,
> constexpr, noexcept, split concepts of trivial classes and standard layout
> classes, even underlying type of enum. These are all better than syntax
> sugar because these help to have more efficient product.

Both of which are striking things to say, but there has already been too
much discussion of C++ in comp.lang.c for me to feel happy to add more.
(I think it's deliberate on BM's part.)

--
Ben.

Re: Book or tutorial on standard C threads

<b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19559&group=comp.lang.c#19559

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:3cb:: with SMTP id k11mr10048151qtx.381.1639939252546;
Sun, 19 Dec 2021 10:40:52 -0800 (PST)
X-Received: by 2002:ac8:6619:: with SMTP id c25mr9907596qtp.390.1639939252380;
Sun, 19 Dec 2021 10:40:52 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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.c
Date: Sun, 19 Dec 2021 10:40:52 -0800 (PST)
In-Reply-To: <87mtkxpjq9.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=94.246.251.164; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 94.246.251.164
References: <sp1gtv$nht$1@dont-email.me> <c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me> <dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me> <spdfc4$1l6$1@dont-email.me>
<spenqd$t0c$1@dont-email.me> <spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk> <spggi3$k89$1@dont-email.me>
<spkl4g$9kd$1@dont-email.me> <66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<87mtkxpjq9.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
Subject: Re: Book or tutorial on standard C threads
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Sun, 19 Dec 2021 18:40:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 27
 by: Öö Tiib - Sun, 19 Dec 2021 18:40 UTC

On Sunday, 19 December 2021 at 01:38:17 UTC+2, Ben Bacarisse wrote:
> Öö Tiib <oot...@hot.ee> writes:
>
> > Lambdas are just syntax simplification of few things
>
> and later...
>
> > C++11 added several performance improvements like move semantics,
> > constexpr, noexcept, split concepts of trivial classes and standard layout
> > classes, even underlying type of enum. These are all better than syntax
> > sugar because these help to have more efficient product.
>
> Both of which are striking things to say, but there has already been too
> much discussion of C++ in comp.lang.c for me to feel happy to add more.
> (I think it's deliberate on BM's part.)

I also realized that so I stopped answering to BM yesterday. Otherwise the
constexpr and underlying types to enums I would love to have in C too.
The constexpr lets to use most of language compile time. That is likely
tricky to implement from scratch but as gcc and clang both have it
anyway then why not. It is rather good both for performance
and testing. The underlying types to enums let to have one byte wide
enums. That is good for performance and also portability in communications.
I do not think it is rather tricky feature.

Re: Book or tutorial on standard C threads

<spnvtl$ukl$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19561&group=comp.lang.c#19561

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Sun, 19 Dec 2021 19:07:35 +0000
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <spnvtl$ukl$1@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me>
<c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me>
<dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me>
<spdfc4$1l6$1@dont-email.me> <spenqd$t0c$1@dont-email.me>
<spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk>
<spggi3$k89$1@dont-email.me> <spkl4g$9kd$1@dont-email.me>
<66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<87mtkxpjq9.fsf@bsb.me.uk>
<b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 19 Dec 2021 19:07:33 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2d465c30d5f3fcf71a3d8d361fa488f4";
logging-data="31381"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196VYNX4Xes8hjUHPZOjvGuKQw6v5702e4="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:yxUB5ajIkjysdJHltdIr4BYv1+o=
In-Reply-To: <b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
 by: Bart - Sun, 19 Dec 2021 19:07 UTC

On 19/12/2021 18:40, Öö Tiib wrote:
> On Sunday, 19 December 2021 at 01:38:17 UTC+2, Ben Bacarisse wrote:
>> Öö Tiib <oot...@hot.ee> writes:
>>
>>> Lambdas are just syntax simplification of few things
>>
>> and later...
>>
>>> C++11 added several performance improvements like move semantics,
>>> constexpr, noexcept, split concepts of trivial classes and standard layout
>>> classes, even underlying type of enum. These are all better than syntax
>>> sugar because these help to have more efficient product.
>>
>> Both of which are striking things to say, but there has already been too
>> much discussion of C++ in comp.lang.c for me to feel happy to add more.
>> (I think it's deliberate on BM's part.)
>
> I also realized that so I stopped answering to BM yesterday. Otherwise the
> constexpr and underlying types to enums I would love to have in C too.
> The constexpr lets to use most of language compile time. That is likely
> tricky to implement from scratch but as gcc and clang both have it
> anyway then why not.

Yeah, in complicated compilers for a complicated language, so more
complication will hardly be noticed!

I have a problem with that feature: since this is user-code being run at
compile-time, how long is a compiler prepared to spend executing such
code? How worthwhile is that effort if it turns out that only a fraction
of it, or none, is actually during any specific run?

The following is something I've just tried; it took nearly 5 seconds to
compile:

#include <stdio.h>

constexpr long long int fib(long long int n) {
long long int a;
if (n<3)
a=1;
else
a=fib(n-2)+fib(n-1);
return a;
}

int A[fib(42)/1000000];

int main(void) {
printf("%d\n", fib(42));
printf("%d\n", sizeof(A)/sizeof(A[0]));
}

Without the constexpr, and using a literal for A's size, it took 0.23
seconds.

It's scary might might happen in a substantional application.

Re: Book or tutorial on standard C threads

<spo0h1$2t0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19562&group=comp.lang.c#19562

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Sun, 19 Dec 2021 20:17:53 +0100
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <spo0h1$2t0$1@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me>
<c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me>
<dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me>
<spdfc4$1l6$1@dont-email.me> <spenqd$t0c$1@dont-email.me>
<spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk>
<spggi3$k89$1@dont-email.me> <spkl4g$9kd$1@dont-email.me>
<66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<87mtkxpjq9.fsf@bsb.me.uk>
<b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
<spnvtl$ukl$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Dec 2021 19:17:53 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="bb3aa90df93646582c03f51598201b08";
logging-data="2976"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SR8DoFPddzH98kYS550ohacV+34ouYsA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:Z/H2kwJ8KLYwbY94N0ZMGxJCUzg=
In-Reply-To: <spnvtl$ukl$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Sun, 19 Dec 2021 19:17 UTC

Am 19.12.2021 um 20:07 schrieb Bart:

> Yeah, in complicated compilers for a complicated language, so more
> complication will hardly be noticed!

The benefit is: you write much less complicated code than with C.

Re: Book or tutorial on standard C threads

<02dd7eda-0b92-4076-b280-793203e573bcn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19563&group=comp.lang.c#19563

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5ad1:: with SMTP id d17mr10159670qtd.23.1639946500354;
Sun, 19 Dec 2021 12:41:40 -0800 (PST)
X-Received: by 2002:a05:622a:40f:: with SMTP id n15mr10004325qtx.296.1639946500215;
Sun, 19 Dec 2021 12:41:40 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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.c
Date: Sun, 19 Dec 2021 12:41:40 -0800 (PST)
In-Reply-To: <spnvtl$ukl$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=94.246.251.164; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 94.246.251.164
References: <sp1gtv$nht$1@dont-email.me> <c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me> <dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me> <spdfc4$1l6$1@dont-email.me>
<spenqd$t0c$1@dont-email.me> <spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk> <spggi3$k89$1@dont-email.me>
<spkl4g$9kd$1@dont-email.me> <66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<87mtkxpjq9.fsf@bsb.me.uk> <b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
<spnvtl$ukl$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <02dd7eda-0b92-4076-b280-793203e573bcn@googlegroups.com>
Subject: Re: Book or tutorial on standard C threads
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Sun, 19 Dec 2021 20:41:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 52
 by: Öö Tiib - Sun, 19 Dec 2021 20:41 UTC

On Sunday, 19 December 2021 at 21:07:45 UTC+2, Bart wrote:
> On 19/12/2021 18:40, Öö Tiib wrote:
> > On Sunday, 19 December 2021 at 01:38:17 UTC+2, Ben Bacarisse wrote:
> >> Öö Tiib <oot...@hot.ee> writes:
> >>
> >>> Lambdas are just syntax simplification of few things
> >>
> >> and later...
> >>
> >>> C++11 added several performance improvements like move semantics,
> >>> constexpr, noexcept, split concepts of trivial classes and standard layout
> >>> classes, even underlying type of enum. These are all better than syntax
> >>> sugar because these help to have more efficient product.
> >>
> >> Both of which are striking things to say, but there has already been too
> >> much discussion of C++ in comp.lang.c for me to feel happy to add more..
> >> (I think it's deliberate on BM's part.)
> >
> > I also realized that so I stopped answering to BM yesterday. Otherwise the
> > constexpr and underlying types to enums I would love to have in C too.
> > The constexpr lets to use most of language compile time. That is likely
> > tricky to implement from scratch but as gcc and clang both have it
> > anyway then why not.
> Yeah, in complicated compilers for a complicated language, so more
> complication will hardly be noticed!
>
> I have a problem with that feature: since this is user-code being run at
> compile-time, how long is a compiler prepared to spend executing such
> code? How worthwhile is that effort if it turns out that only a fraction
> of it, or none, is actually during any specific run?

It like every other feature depends on how programmer uses it. It can
compile 5 seconds longer but start program quicker or it can build
executable quicker but hang 5 seconds at start of every run. Or both,
or neither.

If you are paranoid that your team members sabotage your project
with pointless compile time processing then reduce the maximum
steps of constexpr evaluation in your continuous integration server.

However one who's clever enough can do it with preprocessor
metaprogramming and recursive #includes in C as easily as in
your C++ example. So better hire a team that you trust.

Re: Book or tutorial on standard C threads

<spolu1$aea$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19571&group=comp.lang.c#19571

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Sun, 19 Dec 2021 17:23:12 -0800
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <spolu1$aea$1@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Dec 2021 01:23:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="61d5447f482cfc3032305dc8f67bfdf4";
logging-data="10698"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198vM2IW0O5WGODvWZrE96iTg2yjODDxdQ="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:eKYSJWsKI7rTtmyQR6sYkNKwmjU=
In-Reply-To: <sp1gtv$nht$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Mon, 20 Dec 2021 01:23 UTC

On 12/10/2021 10:36 PM, Mehdi Amini wrote:
> Hi,
>
> Which book or tutorial would you recommend for standard C threads
> introduced in C11 ?

Actually, C11 threads is pretty damn close to POSIX threads. Therefore:

https://books.google.com/books/about/Programming_with_POSIX_Threads.html?id=_xvnuFzo7q0C

Is a nice starter. I had the pleasure to converse with him over on
comp.programming.threads. Very smart man, indeed!

:^)

Re: Book or tutorial on standard C threads

<spp87t$lb7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19572&group=comp.lang.c#19572

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: Book or tutorial on standard C threads
Date: Mon, 20 Dec 2021 07:35:43 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <spp87t$lb7$1@dont-email.me>
References: <sp1gtv$nht$1@dont-email.me> <spolu1$aea$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Dec 2021 06:35:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0b77b345826883a67a978d88c9129ec8";
logging-data="21863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AhtBSAi40n4U7joniaZO4cf6c4TcU54I="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:yl0KvL6nKs8J2u9Le6RGjFIJ/6M=
In-Reply-To: <spolu1$aea$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Mon, 20 Dec 2021 06:35 UTC

Am 20.12.2021 um 02:23 schrieb Chris M. Thomasson:
> On 12/10/2021 10:36 PM, Mehdi Amini wrote:
>> Hi,
>>
>> Which book or tutorial would you recommend for standard C threads
>> introduced in C11 ?
>
> Actually, C11 threads is pretty damn close to POSIX threads. Therefore:
>
> https://books.google.com/books/about/Programming_with_POSIX_Threads.html?id=_xvnuFzo7q0C
>
>
> Is a nice starter. I had the pleasure to converse with him over on
> comp.programming.threads. Very smart man, indeed!
>
> :^)

Take this:

https://ptgmedia.pearsoncmg.com/images/9780201633924/samplepages/0201633922.pdf

Re: Book or tutorial on standard C threads

<f2e2cbee-ed49-470f-8fc0-637e5d70e1a8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19575&group=comp.lang.c#19575

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5712:: with SMTP id 18mr11876834qtw.584.1639999299613;
Mon, 20 Dec 2021 03:21:39 -0800 (PST)
X-Received: by 2002:a05:620a:1905:: with SMTP id bj5mr9381348qkb.94.1639999299450;
Mon, 20 Dec 2021 03:21:39 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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.c
Date: Mon, 20 Dec 2021 03:21:39 -0800 (PST)
In-Reply-To: <02dd7eda-0b92-4076-b280-793203e573bcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:85a6:bb7c:b2f8:cfe0;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:85a6:bb7c:b2f8:cfe0
References: <sp1gtv$nht$1@dont-email.me> <c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me> <dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me> <spdfc4$1l6$1@dont-email.me>
<spenqd$t0c$1@dont-email.me> <spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk> <spggi3$k89$1@dont-email.me>
<spkl4g$9kd$1@dont-email.me> <66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<87mtkxpjq9.fsf@bsb.me.uk> <b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
<spnvtl$ukl$1@dont-email.me> <02dd7eda-0b92-4076-b280-793203e573bcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f2e2cbee-ed49-470f-8fc0-637e5d70e1a8n@googlegroups.com>
Subject: Re: Book or tutorial on standard C threads
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Mon, 20 Dec 2021 11:21:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 62
 by: Malcolm McLean - Mon, 20 Dec 2021 11:21 UTC

On Sunday, 19 December 2021 at 20:41:46 UTC, Öö Tiib wrote:
> On Sunday, 19 December 2021 at 21:07:45 UTC+2, Bart wrote:
> > On 19/12/2021 18:40, Öö Tiib wrote:
> > > On Sunday, 19 December 2021 at 01:38:17 UTC+2, Ben Bacarisse wrote:
> > >> Öö Tiib <oot...@hot.ee> writes:
> > >>
> > >>> Lambdas are just syntax simplification of few things
> > >>
> > >> and later...
> > >>
> > >>> C++11 added several performance improvements like move semantics,
> > >>> constexpr, noexcept, split concepts of trivial classes and standard layout
> > >>> classes, even underlying type of enum. These are all better than syntax
> > >>> sugar because these help to have more efficient product.
> > >>
> > >> Both of which are striking things to say, but there has already been too
> > >> much discussion of C++ in comp.lang.c for me to feel happy to add more.
> > >> (I think it's deliberate on BM's part.)
> > >
> > > I also realized that so I stopped answering to BM yesterday. Otherwise the
> > > constexpr and underlying types to enums I would love to have in C too..
> > > The constexpr lets to use most of language compile time. That is likely
> > > tricky to implement from scratch but as gcc and clang both have it
> > > anyway then why not.
> > Yeah, in complicated compilers for a complicated language, so more
> > complication will hardly be noticed!
> >
> > I have a problem with that feature: since this is user-code being run at
> > compile-time, how long is a compiler prepared to spend executing such
> > code? How worthwhile is that effort if it turns out that only a fraction
> > of it, or none, is actually during any specific run?
> It like every other feature depends on how programmer uses it. It can
> compile 5 seconds longer but start program quicker or it can build
> executable quicker but hang 5 seconds at start of every run. Or both,
> or neither.
>
> If you are paranoid that your team members sabotage your project
> with pointless compile time processing then reduce the maximum
> steps of constexpr evaluation in your continuous integration server.
>
> However one who's clever enough can do it with preprocessor
> metaprogramming and recursive #includes in C as easily as in
> your C++ example. So better hire a team that you trust.
>
We had a case. Someone put in an innocent-seeming compile time
const expression in C++. It worked on the development machines.
Then when pushed to the CI server, it broke.

It's the type of thing which can be quite hard for another programmer to
fix quickly, because you've got to replace the functionality with a totally
different construct.

Re: Book or tutorial on standard C threads

<dcd12d70-2f5b-493d-975a-91c82733249an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19581&group=comp.lang.c#19581

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a0c:8124:: with SMTP id 33mr1665265qvc.77.1640021985784;
Mon, 20 Dec 2021 09:39:45 -0800 (PST)
X-Received: by 2002:a05:6214:246e:: with SMTP id im14mr13631135qvb.59.1640021985643;
Mon, 20 Dec 2021 09:39:45 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.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.c
Date: Mon, 20 Dec 2021 09:39:45 -0800 (PST)
In-Reply-To: <f2e2cbee-ed49-470f-8fc0-637e5d70e1a8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.246.251.164; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 94.246.251.164
References: <sp1gtv$nht$1@dont-email.me> <c35539a6-316d-47b6-8c14-6a5a1070c6c5n@googlegroups.com>
<spahrt$o2h$1@dont-email.me> <Kg4uJ.77766$IB7.11471@fx02.iad>
<spal3l$hh8$1@dont-email.me> <dd0c4355-bae4-42d1-a1cf-5898cb7c7b50n@googlegroups.com>
<spd6hp$t5b$1@dont-email.me> <spd8gl$dq4$1@dont-email.me> <spdfc4$1l6$1@dont-email.me>
<spenqd$t0c$1@dont-email.me> <spfhn3$370$1@dont-email.me> <spfp7o$pv7$1@dont-email.me>
<spfurq$3ll$1@dont-email.me> <87r1acusuf.fsf@bsb.me.uk> <spggi3$k89$1@dont-email.me>
<spkl4g$9kd$1@dont-email.me> <66650d26-8a35-432e-a065-d93ee7eac69an@googlegroups.com>
<87mtkxpjq9.fsf@bsb.me.uk> <b5418603-4c57-45e9-9210-c664055db39cn@googlegroups.com>
<spnvtl$ukl$1@dont-email.me> <02dd7eda-0b92-4076-b280-793203e573bcn@googlegroups.com>
<f2e2cbee-ed49-470f-8fc0-637e5d70e1a8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dcd12d70-2f5b-493d-975a-91c82733249an@googlegroups.com>
Subject: Re: Book or tutorial on standard C threads
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Mon, 20 Dec 2021 17:39:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 72
 by: Öö Tiib - Mon, 20 Dec 2021 17:39 UTC

On Monday, 20 December 2021 at 13:21:46 UTC+2, Malcolm McLean wrote:
> On Sunday, 19 December 2021 at 20:41:46 UTC, Öö Tiib wrote:
> > On Sunday, 19 December 2021 at 21:07:45 UTC+2, Bart wrote:
> > > On 19/12/2021 18:40, Öö Tiib wrote:
> > > > On Sunday, 19 December 2021 at 01:38:17 UTC+2, Ben Bacarisse wrote:
> > > >> Öö Tiib <oot...@hot.ee> writes:
> > > >>
> > > >>> Lambdas are just syntax simplification of few things
> > > >>
> > > >> and later...
> > > >>
> > > >>> C++11 added several performance improvements like move semantics,
> > > >>> constexpr, noexcept, split concepts of trivial classes and standard layout
> > > >>> classes, even underlying type of enum. These are all better than syntax
> > > >>> sugar because these help to have more efficient product.
> > > >>
> > > >> Both of which are striking things to say, but there has already been too
> > > >> much discussion of C++ in comp.lang.c for me to feel happy to add more.
> > > >> (I think it's deliberate on BM's part.)
> > > >
> > > > I also realized that so I stopped answering to BM yesterday. Otherwise the
> > > > constexpr and underlying types to enums I would love to have in C too.
> > > > The constexpr lets to use most of language compile time. That is likely
> > > > tricky to implement from scratch but as gcc and clang both have it
> > > > anyway then why not.
> > > Yeah, in complicated compilers for a complicated language, so more
> > > complication will hardly be noticed!
> > >
> > > I have a problem with that feature: since this is user-code being run at
> > > compile-time, how long is a compiler prepared to spend executing such
> > > code? How worthwhile is that effort if it turns out that only a fraction
> > > of it, or none, is actually during any specific run?
> > It like every other feature depends on how programmer uses it. It can
> > compile 5 seconds longer but start program quicker or it can build
> > executable quicker but hang 5 seconds at start of every run. Or both,
> > or neither.
> >
> > If you are paranoid that your team members sabotage your project
> > with pointless compile time processing then reduce the maximum
> > steps of constexpr evaluation in your continuous integration server.
> >
> > However one who's clever enough can do it with preprocessor
> > metaprogramming and recursive #includes in C as easily as in
> > your C++ example. So better hire a team that you trust.
> >
> We had a case. Someone put in an innocent-seeming compile time
> const expression in C++. It worked on the development machines.
> Then when pushed to the CI server, it broke.
>
> It's the type of thing which can be quite hard for another programmer to
> fix quickly, because you've got to replace the functionality with a totally
> different construct.

Why to fix? Just reject the pull request. Or if it was accidentally merged to
some main development branch then revert.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor