🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.lang.rust
514 messages
514 total messages Page 8 of 11 Started by Lynn McGuire Wed, 14 Oct 2026 04:18
Page 8 of 11 • 514 total messages
Re: “The end of software secrecy is almost upon
#356
Author: Lawrence D’Oliveiro
Date: Mon, 26 Oct 2026 03:47
10 lines
1946 bytes
On Sun, 25 Oct 2026 22:54:14 -0400, Cryptoengineer wrote:

> I distinctly recall working with Sweet-16 on my ][+ back in the day,
> but can't recall the details.

Interpreter for 16-bit integer arithmetic, according to
<https://en.wikipedia.org/wiki/SWEET16>: ran at 1/10th the speed of
native 6502 instructions, but took up just 300 bytes of RAM, but
apparently cut the size of the whole Integer BASIC implementation by
20%.
Re: ?The end of software secrecy is almost upon
#357
Author: Jerry Brown
Date: Mon, 26 Oct 2026 07:59
30 lines
2868 bytes
On Sun, 25 Oct 2026 09:30:12 -0000 (UTC), Thomas Koenig
<tkoenig@netcologne.de> wrote:

>Jerry Brown <jerry@jwbrown.co.uk.invalid> schrieb:
>
>> I supported an IBM 9370 back in the 90s and whatever operating system
>> it ran (completely different to the 3090 mainframe with JCL, etc it
>> was supposed to replace) didn't allow zero length files.
>
>VM/CMS?

That's ringing a vague bell. 

My time on the 9370 was short compared to the 3090, so all I can
remember were things like the file handling was MUCH simpler (no need
specify record types and block sizes and the foreground scripting
language REXX was much nicer than the CLIST we used on the mainframe -
it had stacks for storing and processing data, which was fun.

The only command I can remember was when I had my operator hat on and
a user wanted to access the 3422 tape drive I had to ATTACH the
physical 3 digit id of the tape drive to the logical 3 digit id they
were using (in retrospect I see this was its equivalent of unix mount
command).

-- 
Jerry Brown

A cat may look at a king
(but probably won't bother)
Re: “The end of software secrecy is almost upon
#358
Author: boltar
Date: Mon, 26 Oct 2026 09:51
27 lines
2253 bytes
On Sun, 25 Oct 2026 17:14:18 -0000 (UTC)
cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>In article <11blaui$2q6vd$1@dont-email.me>,  <boltar@caprica.universe> wrote:
>>anyway. Whoops, didn't
>>turn out quite how you expected did it?
>
>Actually, it "turned out" juat about exactly as I expected it
>would.

You have low expectations then.

>>Oh dear, you really have no clue!
>
>You're snotty little attitude aside, I note that you can't even

Anyone who equates system() with multiprocess programming doesn't know wtf 
they're talking about. Hows that for a snotty aside?

>arriculate what, exactly, it is that you want.  "Argument by
>insult" seems about par for the course here, but using that to
>hide your ignorance both doesn't work and makes you look
>incredbily insecure.
>
>Anyway, go ahead and keep flailing.  Ta!

Go ahead and remain clueless.
Re: “The end of software secrecy is almost upon
#359
Author: boltar
Date: Mon, 26 Oct 2026 09:54
23 lines
2271 bytes
On Sun, 25 Oct 2026 17:18:32 -0000 (UTC)
cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>In article <11blaoq$2q6jk$1@dont-email.me>,  <boltar@caprica.universe> wrote:
>>On Sun, 25 Oct 2026 16:15:21 -0000 (UTC)
>>cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>>[snip]
>>>Regardless, if you can set the stack pointer, you can build a
>>>reasonable cooperative threading library purely in userspace,
>>>without the OS caring.
>>
>>Oh really? You seem to have forgotten about the program
>>counter not to
>>mentioning pushing and popping all the other cpu registers
>>and flags at context
>>switch.
>
>One last hint: where do you think those thjngs arw stored?  If
>you could define what a thread is, maybe you'd have a clue
>about how those are handled. :-)

Oh please, try a bit harder. You can do anything you want in ring 0 assembler, 
that doesn't mean its a good idea.
Re: “The end of software secrecy is almost upon
#360
Author: boltar
Date: Mon, 26 Oct 2026 09:59
32 lines
2957 bytes
On Sun, 25 Oct 2026 22:56:19 +0200
Michael S <already5chosen@yahoo.com> gabbled:
>On Sun, 25 Oct 2026 08:41:48 -0000 (UTC)
>boltar@caprica.universe wrote:
>
>> On Sun, 25 Oct 2026 00:28:19 -0000 (UTC)
>> cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>> >In article <20261025011151.000038ef@yahoo.com>,  
>> >>Now, would it be the first thing I would want like addition to C++
>> >>standard library? No it would not be.
>> >>The first thing would be IPv4 communication, sockets, poll etc...  
>> >
>> >POSIX has all of that.  POSIX also has a process model.  Why not
>> >just make POSIX a part of the language, then?  (Answer that and
>> >you may start to understand why this is harder than it looks
>> >for C++ [and C].)  
>> 
>> No, it isn't. How similar do you think the posix and windows threading
>> model/api are? Yet somehow C++ provides a common wrapper for both.
>
>Actually, implementing C++11 (or C11) threads fully in user space on
>pre-Vista Win32 (i.e. before addition of support for conditional
>variables to OS API) would be quite challenging. I don't know if
>anybody bothered.
>I think that it is possible, but if you want it robust then it (cond.
>variables) will cost you significant overhead relatively to "native"
>synchronization primitives.

C++ threading didn't have 3 level locking until 2017 making it effectively 
useless IMO. Perhaps that was down to the lowest common denominator called 
Windows.
Re: Re: “The end of software secrecy is almost upon
#361
Author: boltar
Date: Mon, 26 Oct 2026 10:01
31 lines
2956 bytes
On Sun, 25 Oct 2026 14:19:14 -0700
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>On 10/25/2026 1:34 AM, boltar@caprica.universe wrote:
>> On Sat, 24 Oct 2026 13:57:02 -0400 (EDT)
>> kludge@panix.com (Scott Dorsey) gabbled:
>>> In article <11bif5s$2pam0$1@dont-email.me>,
>>> Peter Flass  <Peter@Iron-Spring.com> wrote:
>>>> You can have co-operative threads. IBM CICS used to run lots of threads
>>>> (tasks) concurrently, and ran them well.
>>>
>>> When I learned C, there was no threading and there were only different
>>> processes, so you had to do a fork and then synchronize with the other
>>> process.  This wasn't a dealbreaker and we did plenty of stuff that way,
>>> but having threads available was very nice and made for many operations
>>> becoming more convenient to write.
>> 
>> Unfortunately most win32 programmers don't really understand multiprocess
>> programming because the w32 API is so borked so use threads even when
>> seperate process would be more appropriate.
>> 
>> 
>
>Windows has what we need to run multi process. Even for a Mutex... 
>Remember WAIT_ABANDONED?

win32 can't do fork() making it effectively a totally useless API for 
a lot of multiprocess development. Creating a brand new process is fine if
you don't need any complicated shared state such as when kicking off something
on the command line or creating a pipe (something else win32 is shit at) but
thats about it.
Re: Re: “The end of software secrecy is almost upon
#362
Author: boltar
Date: Mon, 26 Oct 2026 10:02
13 lines
2020 bytes
On Sun, 25 Oct 2026 14:22:34 -0700
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>On 10/25/2026 1:31 AM, boltar@caprica.universe wrote:
>> The differences are utterly irrelevant when it comes to prividing a common
>> API to the functionality but thank you for demonstrating you had no answer
>> to my question.
>> 
>
>Ummm... It is relevant. Every process has a single thread of execution, 
>but not all processes have multiple threads.

No shit sherlock, thanks for the heads up. Your point is?
Re: ?The end of software secrecy is almost upon
#363
Author: Dan Cross
Date: Mon, 26 Oct 2026 10:33
35 lines
2554 bytes
In article <5e1udl9hs8733aqpjenq0vk71v3pn25q8n@jwbrown.co.uk>,
Jerry Brown  <jerry@jwbrown.co.uk.invalid> wrote:
>On Sun, 25 Oct 2026 09:30:12 -0000 (UTC), Thomas Koenig
><tkoenig@netcologne.de> wrote:
>
>>Jerry Brown <jerry@jwbrown.co.uk.invalid> schrieb:
>>
>>> I supported an IBM 9370 back in the 90s and whatever operating system
>>> it ran (completely different to the 3090 mainframe with JCL, etc it
>>> was supposed to replace) didn't allow zero length files.
>>
>>VM/CMS?
>
>That's ringing a vague bell.
>
>My time on the 9370 was short compared to the 3090, so all I can
>remember were things like the file handling was MUCH simpler (no need
>specify record types and block sizes and the foreground scripting
>language REXX was much nicer than the CLIST we used on the mainframe -
>it had stacks for storing and processing data, which was fun.
>
>The only command I can remember was when I had my operator hat on and
>a user wanted to access the 3422 tape drive I had to ATTACH the
>physical 3 digit id of the tape drive to the logical 3 digit id they
>were using (in retrospect I see this was its equivalent of unix mount
>command).

That sounds like VM/ESA, all right.  Command list `LIST` and
`TYPE` and a three-field file name relative to a "minidisk"?
REXX was the "usual" scripting language.

VM was kind of neat.

	- Dan C.
Re: “The end of software secrecy is almost upon
#364
Author: Scott Dorsey
Date: Mon, 26 Oct 2026 13:50
9 lines
1337 bytes
In article <11bn80e$11hkj$1@dont-email.me>,  <boltar@caprica.universe> wrote:
>Oh please, try a bit harder. You can do anything you want in ring 0 assembler, 
>that doesn't mean its a good idea.

As someone who is spending his morning writing 8051 code, I think it can be
a very very good idea.
--scott
-- 
"C'est un Nagra. C'est suisse, et tres, tres precis."
Re: “The end of software secrecy is almost upon
#365
Author: Scott Lurndal
Date: Mon, 26 Oct 2026 14:41
44 lines
3256 bytes
boltar@caprica.universe writes:
>On Sun, 25 Oct 2026 22:56:19 +0200
>Michael S <already5chosen@yahoo.com> gabbled:
>>On Sun, 25 Oct 2026 08:41:48 -0000 (UTC)
>>boltar@caprica.universe wrote:
>>
>>> On Sun, 25 Oct 2026 00:28:19 -0000 (UTC)
>>> cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>> >In article <20261025011151.000038ef@yahoo.com>,  
>>> >>Now, would it be the first thing I would want like addition to C++
>>> >>standard library? No it would not be.
>>> >>The first thing would be IPv4 communication, sockets, poll etc...  
>>> >
>>> >POSIX has all of that.  POSIX also has a process model.  Why not
>>> >just make POSIX a part of the language, then?  (Answer that and
>>> >you may start to understand why this is harder than it looks
>>> >for C++ [and C].)  
>>> 
>>> No, it isn't. How similar do you think the posix and windows threading
>>> model/api are? Yet somehow C++ provides a common wrapper for both.
>>
>>Actually, implementing C++11 (or C11) threads fully in user space on
>>pre-Vista Win32 (i.e. before addition of support for conditional
>>variables to OS API) would be quite challenging. I don't know if
>>anybody bothered.
>>I think that it is possible, but if you want it robust then it (cond.
>>variables) will cost you significant overhead relatively to "native"
>>synchronization primitives.
>
>C++ threading didn't have 3 level locking until 2017 making it effectively 
>useless IMO. Perhaps that was down to the lowest common denominator called 
>Windows.
>

Mind defining your terminology?   "3 level locking", in particular?

Assigning a canonical "lock number" to each lock, and failing a lock
request for a lock with a lower number than that already held is
a design pattern that has been around since 1980 (in Burroughs
mainframes it was implemented in hardware).   Easy enough to do
prior to C++17 in software.

And your assertion that a language that doesn't support it intrinsically
is "useless" is ridiculous.
Re: “The end of software secrecy is almost upon
#366
Author: boltar
Date: Mon, 26 Oct 2026 16:16
33 lines
2686 bytes
On Mon, 26 Oct 2026 14:41:54 GMT
scott@slp53.sl.home (Scott Lurndal) gabbled:
>boltar@caprica.universe writes:
>>C++ threading didn't have 3 level locking until 2017 making it effectively 
>>useless IMO. Perhaps that was down to the lowest common denominator called 
>>Windows.
>>
>
>Mind defining your terminology?   "3 level locking", in particular?

If you have to ask....

1. No lock
2. Write lock - Read only access, writer blocked until all readers out of critic
al section)
3. Read-write lock  - all threads other than the one in section block)

This is basic stuff FFS. C++ finally got around to #2 with shared_mutex in
2017 and its rather critical for certain algorithms.

>Assigning a canonical "lock number" to each lock, and failing a lock
>request for a lock with a lower number than that already held is
>a design pattern that has been around since 1980 (in Burroughs
>mainframes it was implemented in hardware).   Easy enough to do
>prior to C++17 in software.

Thats something else entirely.

>And your assertion that a language that doesn't support it intrinsically
>is "useless" is ridiculous.

Not useless then, just less useful.
Re: “The end of software secrecy is almost upon
#367
Author: Dan Cross
Date: Mon, 26 Oct 2026 16:58
14 lines
1680 bytes
In article <11bnlrn$ghl$1@panix2.panix.com>,
Scott Dorsey <kludge@panix.com> wrote:
>In article <11bn80e$11hkj$1@dont-email.me>,  <boltar@caprica.universe> wrote:
>>Oh please, try a bit harder. You can do anything you want in ring 0 assembler,
>>that doesn't mean its a good idea.
>
>As someone who is spending his morning writing 8051 code, I think it can be
>a very very good idea.

The irony is that, by definition, if you are running something
in userspace, it's not in "Ring 0" anyway.

	- Dan C.
Re: “The end of software secrecy is almost upon
#368
Author: Blaine
Date: Mon, 26 Oct 2026 19:10
26 lines
2695 bytes
boltar@caprica.universe wrote:
> On Sun, 25 Oct 2026 14:22:34 -0700
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>> On 10/25/2026 1:31 AM, boltar@caprica.universe wrote:
>>> The differences are utterly irrelevant when it comes to prividing a 
>>> common
>>> API to the functionality but thank you for demonstrating you had no 
>>> answer
>>> to my question.
>>>
>>
>> Ummm... It is relevant. Every process has a single thread of 
>> execution, but not all processes have multiple threads.
> 
> No shit sherlock, thanks for the heads up. Your point is?
> 
Basically that methinks you insult too much. Your wisdom here isn't 
worth a sack of beans. I haven't learned one thing from you.

-- 
Can you strip away so we may start again?
"There’s a switch and they don't
seem authentic or themselves. It
feels like I’m an unnecessary
body and it’s a waste of time to
even be there." -- Grim, playful Blaine.
Re: “The end of software secrecy is almost upon
#369
Author: Scott Dorsey
Date: Mon, 26 Oct 2026 19:32
19 lines
1787 bytes
Dan Cross <cross@spitfire.i.gajendra.net> wrote:
>In article <11bnlrn$ghl$1@panix2.panix.com>,
>Scott Dorsey <kludge@panix.com> wrote:
>>In article <11bn80e$11hkj$1@dont-email.me>,  <boltar@caprica.universe> wrote:
>>>Oh please, try a bit harder. You can do anything you want in ring 0 assembler,
>>>that doesn't mean its a good idea.
>>
>>As someone who is spending his morning writing 8051 code, I think it can be
>>a very very good idea.
>
>The irony is that, by definition, if you are running something
>in userspace, it's not in "Ring 0" anyway.

On the 8051 there is only one ring.  It is like Middle Earth in that regard.
It does have an atomic test and set instruction, though, which is more than
I can say for some machines.
--scott
-- 
"C'est un Nagra. C'est suisse, et tres, tres precis."
Re: “The end of software secrecy is almost upon
#370
Author: Titus G
Date: Mon, 26 Oct 2026 19:43
8 lines
1954 bytes
On 27/10/2026 08:10, Blaine wrote:

> Basically that methinks you insult too much. Your wisdom here isn't
> worth a sack of beans. I haven't learned one thing from you.

What a laugh. You are the clown replying to Starmaker.

Re: “The end of software secrecy is almost upon
#371
Author: Michael S
Date: Mon, 26 Oct 2026 19:45
54 lines
3598 bytes
On Mon, 26 Oct 2026 16:16:46 -0000 (UTC)
boltar@caprica.universe wrote:

> On Mon, 26 Oct 2026 14:41:54 GMT
> scott@slp53.sl.home (Scott Lurndal) gabbled:
> >boltar@caprica.universe writes:  
> >>C++ threading didn't have 3 level locking until 2017 making it
> >>effectively useless IMO. Perhaps that was down to the lowest common
> >>denominator called Windows.
> >>  
> >
> >Mind defining your terminology?   "3 level locking", in particular?  
> 
> If you have to ask....
> 
> 1. No lock
> 2. Write lock - Read only access, writer blocked until all readers
> out of critic al section)
> 3. Read-write lock  - all threads other than the one in section block)
> 

Windows got Slim Reader/Writer Locks in Vista (2006-11) at the same
time as conditional variables. 5 years before C++11.
https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
Of course WinXP remained popular for few more years, approximately up
until 2nd half of 2010, but that too predates publication of C++11 in
2011-09.

> This is basic stuff FFS. C++ finally got around to #2 with
> shared_mutex in 2017 and its rather critical for certain algorithms.
> 
> >Assigning a canonical "lock number" to each lock, and failing a lock
> >request for a lock with a lower number than that already held is
> >a design pattern that has been around since 1980 (in Burroughs
> >mainframes it was implemented in hardware).   Easy enough to do
> >prior to C++17 in software.  
> 
> Thats something else entirely.
> 
> >And your assertion that a language that doesn't support it
> >intrinsically is "useless" is ridiculous.  
> 
> Not useless then, just less useful.
>

I never ever used what you call "3 level locking", not even by mistake.
But then, I don't write complicated apps on "big" computers day in day
out.





Re: “The end of software secrecy is almost upon
#372
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:03
44 lines
3461 bytes
On 10/26/2026 3:01 AM, boltar@caprica.universe wrote:
> On Sun, 25 Oct 2026 14:19:14 -0700
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>> On 10/25/2026 1:34 AM, boltar@caprica.universe wrote:
>>> On Sat, 24 Oct 2026 13:57:02 -0400 (EDT)
>>> kludge@panix.com (Scott Dorsey) gabbled:
>>>> In article <11bif5s$2pam0$1@dont-email.me>,
>>>> Peter Flass  <Peter@Iron-Spring.com> wrote:
>>>>> You can have co-operative threads. IBM CICS used to run lots of 
>>>>> threads
>>>>> (tasks) concurrently, and ran them well.
>>>>
>>>> When I learned C, there was no threading and there were only different
>>>> processes, so you had to do a fork and then synchronize with the other
>>>> process.  This wasn't a dealbreaker and we did plenty of stuff that 
>>>> way,
>>>> but having threads available was very nice and made for many operations
>>>> becoming more convenient to write.
>>>
>>> Unfortunately most win32 programmers don't really understand 
>>> multiprocess
>>> programming because the w32 API is so borked so use threads even when
>>> seperate process would be more appropriate.
>>>
>>>
>>
>> Windows has what we need to run multi process. Even for a Mutex... 
>> Remember WAIT_ABANDONED?
> 
> win32 can't do fork() making it effectively a totally useless API for a 
> lot of multiprocess development.

Afaict, its not useless.

> Creating a brand new process is fine if
> you don't need any complicated shared state such as when kicking off 
> something
> on the command line or creating a pipe (something else win32 is shit at) 
> but
> thats about it.
> 

Shared state? Just use memory mapped files. You don't need pipes/sockets 
etc. You need to know how to properly sync things.
Re: “The end of software secrecy is almost upon
#373
Author: Michael S
Date: Mon, 26 Oct 2026 20:04
49 lines
3403 bytes
On Mon, 26 Oct 2026 09:51:51 -0000 (UTC)
boltar@caprica.universe wrote:

> On Sun, 25 Oct 2026 17:14:18 -0000 (UTC)
> cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
> >In article <11blaui$2q6vd$1@dont-email.me>,
> ><boltar@caprica.universe> wrote:  
> >>anyway. Whoops, didn't
> >>turn out quite how you expected did it?  
> >
> >Actually, it "turned out" juat about exactly as I expected it
> >would.  
> 
> You have low expectations then.
> 
> >>Oh dear, you really have no clue!  
> >
> >You're snotty little attitude aside, I note that you can't even  
> 
> Anyone who equates system() with multiprocess programming doesn't
> know wtf they're talking about. Hows that for a snotty aside?
> 
> >arriculate what, exactly, it is that you want.  "Argument by
> >insult" seems about par for the course here, but using that to
> >hide your ignorance both doesn't work and makes you look
> >incredbily insecure.
> >
> >Anyway, go ahead and keep flailing.  Ta!  
> 
> Go ahead and remain clueless.
> 


system() can do most of the same things as spawn() family.
The problem with system() is not that. Often not even an efficiency.
The problem with system() identified most easily if we ask ourself "Why
do we want xyz in standard library?" 
Sometimes the answer is "because functionality is not available
otherwise". 
But more often functonality is available in native OS API. Not just
that, typically functionality of native APIs is better than one of
standard language library.
So, what is the other reason? It is portability at source level + "learn
once use everywhere".
Here system() fails. That is, the function is the same everywhere, but
string argument is OS-dependent. So, system() may be achieves
functionality, but does not really help portability.

Re: “The end of software secrecy is almost upon
#374
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:05
35 lines
3317 bytes
On 10/26/2026 2:59 AM, boltar@caprica.universe wrote:
> On Sun, 25 Oct 2026 22:56:19 +0200
> Michael S <already5chosen@yahoo.com> gabbled:
>> On Sun, 25 Oct 2026 08:41:48 -0000 (UTC)
>> boltar@caprica.universe wrote:
>>
>>> On Sun, 25 Oct 2026 00:28:19 -0000 (UTC)
>>> cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>>> In article <20261025011151.000038ef@yahoo.com>,
>>>>> Now, would it be the first thing I would want like addition to C++
>>>>> standard library? No it would not be.
>>>>> The first thing would be IPv4 communication, sockets, poll etc...
>>>>
>>>> POSIX has all of that.  POSIX also has a process model.  Why not
>>>> just make POSIX a part of the language, then?  (Answer that and
>>>> you may start to understand why this is harder than it looks
>>>> for C++ [and C].)
>>>
>>> No, it isn't. How similar do you think the posix and windows threading
>>> model/api are? Yet somehow C++ provides a common wrapper for both.
>>
>> Actually, implementing C++11 (or C11) threads fully in user space on
>> pre-Vista Win32 (i.e. before addition of support for conditional
>> variables to OS API) would be quite challenging. I don't know if
>> anybody bothered.
>> I think that it is possible, but if you want it robust then it (cond.
>> variables) will cost you significant overhead relatively to "native"
>> synchronization primitives.
> 
> C++ threading didn't have 3 level locking until 2017 making it effectively
> useless IMO. Perhaps that was down to the lowest common denominator called
> Windows.
> 

3 level locking? What do you mean?
Re: “The end of software secrecy is almost upon
#375
Author: Michael S
Date: Mon, 26 Oct 2026 20:09
45 lines
3441 bytes
On Mon, 26 Oct 2026 10:01:55 -0000 (UTC)
boltar@caprica.universe wrote:

> On Sun, 25 Oct 2026 14:19:14 -0700
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
> >On 10/25/2026 1:34 AM, boltar@caprica.universe wrote:  
> >> On Sat, 24 Oct 2026 13:57:02 -0400 (EDT)
> >> kludge@panix.com (Scott Dorsey) gabbled:  
> >>> In article <11bif5s$2pam0$1@dont-email.me>,
> >>> Peter Flass  <Peter@Iron-Spring.com> wrote:  
> >>>> You can have co-operative threads. IBM CICS used to run lots of
> >>>> threads (tasks) concurrently, and ran them well.  
> >>>
> >>> When I learned C, there was no threading and there were only
> >>> different processes, so you had to do a fork and then synchronize
> >>> with the other process.  This wasn't a dealbreaker and we did
> >>> plenty of stuff that way, but having threads available was very
> >>> nice and made for many operations becoming more convenient to
> >>> write.  
> >> 
> >> Unfortunately most win32 programmers don't really understand
> >> multiprocess programming because the w32 API is so borked so use
> >> threads even when seperate process would be more appropriate.
> >> 
> >>   
> >
> >Windows has what we need to run multi process. Even for a Mutex... 
> >Remember WAIT_ABANDONED?  
> 
> win32 can't do fork() making it effectively a totally useless API for 
> a lot of multiprocess development. Creating a brand new process is
> fine if you don't need any complicated shared state such as when
> kicking off something on the command line or creating a pipe
> (something else win32 is shit at) but thats about it.
> 

You are clueless about Windows. That's o.k.
Your pretense that you know something about it is not o.k.
In that regard you are not better than LDO.





Re: “The end of software secrecy is almost upon
#376
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:12
241 lines
8026 bytes
On 10/26/2026 12:45 PM, Michael S wrote:
> On Mon, 26 Oct 2026 16:16:46 -0000 (UTC)
> boltar@caprica.universe wrote:
> 
>> On Mon, 26 Oct 2026 14:41:54 GMT
>> scott@slp53.sl.home (Scott Lurndal) gabbled:
>>> boltar@caprica.universe writes:
>>>> C++ threading didn't have 3 level locking until 2017 making it
>>>> effectively useless IMO. Perhaps that was down to the lowest common
>>>> denominator called Windows.
>>>>   
>>>
>>> Mind defining your terminology?   "3 level locking", in particular?
>>
>> If you have to ask....
>>
>> 1. No lock
>> 2. Write lock - Read only access, writer blocked until all readers
>> out of critic al section)
>> 3. Read-write lock  - all threads other than the one in section block)
>>
> 
> Windows got Slim Reader/Writer Locks in Vista (2006-11) at the same
> time as conditional variables. 5 years before C++11.
> https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
> Of course WinXP remained popular for few more years, approximately up
> until 2nd half of 2010, but that too predates publication of C++11 in
> 2011-09.
> 
>> This is basic stuff FFS. C++ finally got around to #2 with
>> shared_mutex in 2017 and its rather critical for certain algorithms.
>>
>>> Assigning a canonical "lock number" to each lock, and failing a lock
>>> request for a lock with a lower number than that already held is
>>> a design pattern that has been around since 1980 (in Burroughs
>>> mainframes it was implemented in hardware).   Easy enough to do
>>> prior to C++17 in software.
>>
>> Thats something else entirely.
>>
>>> And your assertion that a language that doesn't support it
>>> intrinsically is "useless" is ridiculous.
>>
>> Not useless then, just less useful.
>>
> 
> I never ever used what you call "3 level locking", not even by mistake.
> But then, I don't write complicated apps on "big" computers day in day
> out.
Still don't really know what he means by 3 level locking. Using lock 
hashing where an address is hashed into a lock index such that no object 
needs its own lock is nothing new. But it needs to be sorted and deduped.

(google groups wrt usenet seems to be back up now)
https://groups.google.com/g/comp.lang.c++/c/sV4WC_cBb9Q/m/SkSqpSxGCAAJ

some of my old relacy code:

#include <relacy/relacy.hpp>
#include <cstdio>
#include <cstddef>
#include <cstdlib>
#include <string>
#include <vector>

#if ! defined (NDEBUG)
#   define CT_DBG_PRINTF(e) std::printf e
#else
#   define CT_DBG_PRINTF(e) ((void)0)
#endif


#define CT_THREADS (5)
#define CT_MUTEX_TABLE_N (64)


struct ct_mutex_table
{
     rl::mutex m_mutexs[CT_MUTEX_TABLE_N];

     std::size_t
     hash_ptr(
         void* p
     ) const {
         return rl::hash_ptr(p, CT_MUTEX_TABLE_N);
     }
};


struct ct_thread_mutex_hash
{
     std::vector<std::size_t> m_hashed_idxs;

     // must be before any locks!
     void finalize()
     {
         std::sort(
             m_hashed_idxs.begin(),
             m_hashed_idxs.end());

         m_hashed_idxs.erase(
             std::unique(
                 m_hashed_idxs.begin(),
                 m_hashed_idxs.end()),
             m_hashed_idxs.end());
     }


     // BEFORE WE CALL, WE NEED TO sort and dedup before this.
     void
     lock(
         ct_mutex_table& mutex_table
     ) {
         for (auto& mtx_idx : m_hashed_idxs)
         {
             rl::mutex& mtx = mutex_table.m_mutexs[mtx_idx];
             mtx.lock($);
         }
     }

     // does not really even need to be reversed...
     void
     unlock(
         ct_mutex_table& mutex_table
     ) {
         for (auto& mtx_idx : m_hashed_idxs)
         {
             rl::mutex& mtx = mutex_table.m_mutexs[mtx_idx];
             mtx.unlock($);
         }
     }
};


struct ct_state
{
     ct_mutex_table m_mutex_table;
     VAR_T(int) m_var_0 = 0;
     VAR_T(int) m_var_1 = 1;
     VAR_T(int) m_var_2 = 2;


     void worker_thread_a()
     {
         ct_thread_mutex_hash self_hash;

         self_hash.m_hashed_idxs.push_back(
             m_mutex_table.hash_ptr(&m_var_0));

         self_hash.m_hashed_idxs.push_back(
             m_mutex_table.hash_ptr(&m_var_1));

         self_hash.finalize();

         self_hash.lock(m_mutex_table);

         VAR(m_var_0) = 42;
         VAR(m_var_1) = 128;

         self_hash.unlock(m_mutex_table);
     }

     void worker_thread_b()
     {
         ct_thread_mutex_hash self_hash;

         // Seed!
         {
             self_hash.m_hashed_idxs.push_back(
                 m_mutex_table.hash_ptr(&m_var_1));

             self_hash.m_hashed_idxs.push_back(
                 m_mutex_table.hash_ptr(&m_var_0));
         }


         // Okay... Finalize it...
         {
             self_hash.finalize();
         }


         // Finally, we can lock the bastard!
         {
             self_hash.lock(m_mutex_table);

             {
                 VAR(m_var_0) = 99;
                 VAR(m_var_1) = 77;
             }

             self_hash.unlock(m_mutex_table);
         }
     }
};


struct ct_multex_relacy_test_v000
     : rl::test_suite<ct_multex_relacy_test_v000, CT_THREADS>
{
     ct_state m_state = { };

     void before()
     {
         // not sure to init m_state here. Is it already init?
     }

     void
     thread(
         unsigned tidx
     ) {
         if (tidx == 0)
             m_state.worker_thread_a();
         else
             m_state.worker_thread_b();
     }
};


int main(int argc, char** argv)
{
     {
         rl::test_params p;

         p.iteration_count = argc > 1 ? (unsigned)atoi(argv[1]) : 100000;
         p.execution_depth_limit = 100000;

         if (argc > 2) {
             std::string m = argv[2];
             if (m == "full") p.search_type = rl::sched_full;
             else if (m == "bound") { p.search_type = rl::sched_bound; 
p.context_bound = argc > 3 ? atoi(argv[3]) : 2; }
         }

         rl::simulate<ct_multex_relacy_test_v000>(p);
     }

     return 0;
}

Re: “The end of software secrecy is almost upon
#377
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:20
18 lines
2399 bytes
On 10/26/2026 3:02 AM, boltar@caprica.universe wrote:
> On Sun, 25 Oct 2026 14:22:34 -0700
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>> On 10/25/2026 1:31 AM, boltar@caprica.universe wrote:
>>> The differences are utterly irrelevant when it comes to prividing a 
>>> common
>>> API to the functionality but thank you for demonstrating you had no 
>>> answer
>>> to my question.
>>>
>>
>> Ummm... It is relevant. Every process has a single thread of 
>> execution, but not all processes have multiple threads.
> 
> No shit sherlock, thanks for the heads up. Your point is?
> 

My point is that you seem to be daft on these issues. Are you trolling?
Re: “The end of software secrecy is almost upon
#378
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:23
21 lines
3376 bytes
On 10/25/2026 8:43 PM, Lawrence D’Oliveiro wrote:
> On Sun, 25 Oct 2026 19:28:00 -0700, Chris M. Thomasson wrote:
> 
>> A lib that never allocates behind your back is what you
>> want in embedded, kernel, and arena code ...
> 
> Even kernels want a common memory-management architecture, so addon
> modules don’t have to reinvent memory management on their own.
> 
> Think of something like allocating low-priority cache memory, for
> stuff that can be dumped if necessary: that needs to be managed in the
> core of the kernel, so that if apps need regular memory for things
> they want to keep in memory, the kernel can free up cache as necessary
> to make more memory available.
> 
> Stop trying to rationalize away the whole point of dynamic memory
> allocation.

If you need dynamic memory fine. If a lib allocates things for itself, 
fine. Just make sure to know how to clean it up. Also, the caller can 
use dynamic memory if it wants to. RAII is pretty nice here.
Re: “The end of software secrecy is almost upon
#379
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:26
13 lines
2750 bytes
On 10/25/2026 8:39 PM, Lawrence D’Oliveiro wrote:
> On Sun, 25 Oct 2026 19:11:48 -0700, Chris M. Thomasson wrote:
> 
>> A caller provided buffer is normal with a lot of API's out there.
> 
> No it isn’t. It’s not a good way to manage things, anyway: instead of
> solving the resource-allocation problem once and for all in the
> library API, you are pushing the burden onto all the client code, each
> one of which has to solve it for itself.
> 
> That’s a dumb way to design things.

HUH? How do you call say, fread without a user provided buffer?
Re: “The end of software secrecy is almost upon
#380
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:29
10 lines
2544 bytes
On 10/25/2026 8:40 PM, Lawrence D’Oliveiro wrote:
> On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:
> 
>> Managing the memory is the caller’s job in C anyway.
> 
> Does that apply to the caller of library APIs like malloc(3) and
> free(3)?

Yes. The caller calls malloc, if it succeeded, the caller needs to free 
what it got... Right?
Re: “The end of software secrecy is almost upon
#381
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:33
14 lines
2741 bytes
On 10/26/2026 1:29 PM, Chris M. Thomasson wrote:
> On 10/25/2026 8:40 PM, Lawrence D’Oliveiro wrote:
>> On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:
>>
>>> Managing the memory is the caller’s job in C anyway.
>>
>> Does that apply to the caller of library APIs like malloc(3) and
>> free(3)?
> 
> Yes. The caller calls malloc, if it succeeded, the caller needs to free 
> what it got... Right?

Say a lib that has foo_create... Well, the damn called must remember to 
call foo_destroy, right?
Re: “The end of software secrecy is almost upon
#382
Author: Michael S
Date: Mon, 26 Oct 2026 20:40
68 lines
4396 bytes
On Mon, 26 Oct 2026 13:12:24 -0700
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:

> On 10/26/2026 12:45 PM, Michael S wrote:
> > On Mon, 26 Oct 2026 16:16:46 -0000 (UTC)
> > boltar@caprica.universe wrote:
> >   
> >> On Mon, 26 Oct 2026 14:41:54 GMT
> >> scott@slp53.sl.home (Scott Lurndal) gabbled:  
> >>> boltar@caprica.universe writes:  
> >>>> C++ threading didn't have 3 level locking until 2017 making it
> >>>> effectively useless IMO. Perhaps that was down to the lowest
> >>>> common denominator called Windows.
> >>>>     
> >>>
> >>> Mind defining your terminology?   "3 level locking", in
> >>> particular?  
> >>
> >> If you have to ask....
> >>
> >> 1. No lock
> >> 2. Write lock - Read only access, writer blocked until all readers
> >> out of critic al section)
> >> 3. Read-write lock  - all threads other than the one in section
> >> block) 
> > 
> > Windows got Slim Reader/Writer Locks in Vista (2006-11) at the same
> > time as conditional variables. 5 years before C++11.
> > https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
> > Of course WinXP remained popular for few more years, approximately
> > up until 2nd half of 2010, but that too predates publication of
> > C++11 in 2011-09.
> >   
> >> This is basic stuff FFS. C++ finally got around to #2 with
> >> shared_mutex in 2017 and its rather critical for certain
> >> algorithms. 
> >>> Assigning a canonical "lock number" to each lock, and failing a
> >>> lock request for a lock with a lower number than that already
> >>> held is a design pattern that has been around since 1980 (in
> >>> Burroughs mainframes it was implemented in hardware).   Easy
> >>> enough to do prior to C++17 in software.  
> >>
> >> Thats something else entirely.
> >>  
> >>> And your assertion that a language that doesn't support it
> >>> intrinsically is "useless" is ridiculous.  
> >>
> >> Not useless then, just less useful.
> >>  
> > 
> > I never ever used what you call "3 level locking", not even by
> > mistake. But then, I don't write complicated apps on "big"
> > computers day in day out.  
> Still don't really know what he means by 3 level locking. Using lock 
> hashing where an address is hashed into a lock index such that no
> object needs its own lock is nothing new. But it needs to be sorted
> and deduped.
> 

He explained it in the post above.
It seem that he mistyped few things in explanation, but it is possible
to understand intentions. He is talking about std::shared_mutex.





Re: “The end of software secrecy is almost upon
#383
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 20:44
66 lines
4574 bytes
On 10/26/2026 1:40 PM, Michael S wrote:
> On Mon, 26 Oct 2026 13:12:24 -0700
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:
> 
>> On 10/26/2026 12:45 PM, Michael S wrote:
>>> On Mon, 26 Oct 2026 16:16:46 -0000 (UTC)
>>> boltar@caprica.universe wrote:
>>>    
>>>> On Mon, 26 Oct 2026 14:41:54 GMT
>>>> scott@slp53.sl.home (Scott Lurndal) gabbled:
>>>>> boltar@caprica.universe writes:
>>>>>> C++ threading didn't have 3 level locking until 2017 making it
>>>>>> effectively useless IMO. Perhaps that was down to the lowest
>>>>>> common denominator called Windows.
>>>>>>      
>>>>>
>>>>> Mind defining your terminology?   "3 level locking", in
>>>>> particular?
>>>>
>>>> If you have to ask....
>>>>
>>>> 1. No lock
>>>> 2. Write lock - Read only access, writer blocked until all readers
>>>> out of critic al section)
>>>> 3. Read-write lock  - all threads other than the one in section
>>>> block)
>>>
>>> Windows got Slim Reader/Writer Locks in Vista (2006-11) at the same
>>> time as conditional variables. 5 years before C++11.
>>> https://learn.microsoft.com/en-us/windows/win32/sync/slim-reader-writer--srw--locks
>>> Of course WinXP remained popular for few more years, approximately
>>> up until 2nd half of 2010, but that too predates publication of
>>> C++11 in 2011-09.
>>>    
>>>> This is basic stuff FFS. C++ finally got around to #2 with
>>>> shared_mutex in 2017 and its rather critical for certain
>>>> algorithms.
>>>>> Assigning a canonical "lock number" to each lock, and failing a
>>>>> lock request for a lock with a lower number than that already
>>>>> held is a design pattern that has been around since 1980 (in
>>>>> Burroughs mainframes it was implemented in hardware).   Easy
>>>>> enough to do prior to C++17 in software.
>>>>
>>>> Thats something else entirely.
>>>>   
>>>>> And your assertion that a language that doesn't support it
>>>>> intrinsically is "useless" is ridiculous.
>>>>
>>>> Not useless then, just less useful.
>>>>   
>>>
>>> I never ever used what you call "3 level locking", not even by
>>> mistake. But then, I don't write complicated apps on "big"
>>> computers day in day out.
>> Still don't really know what he means by 3 level locking. Using lock
>> hashing where an address is hashed into a lock index such that no
>> object needs its own lock is nothing new. But it needs to be sorted
>> and deduped.
>>
> 
> He explained it in the post above.
> It seem that he mistyped few things in explanation, but it is possible
> to understand intentions. He is talking about std::shared_mutex.

Ahhh! I call that a read/write mutex. Okay.
Re: “The end of software secrecy is almost upon
#384
Author: David Brown
Date: Mon, 26 Oct 2026 21:29
16 lines
2828 bytes
On 26/10/2026 21:29, Chris M. Thomasson wrote:
> On 10/25/2026 8:40 PM, Lawrence D’Oliveiro wrote:
>> On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:
>>
>>> Managing the memory is the caller’s job in C anyway.
>>
>> Does that apply to the caller of library APIs like malloc(3) and
>> free(3)?
> 
> Yes. The caller calls malloc, if it succeeded, the caller needs to free 
> what it got... Right?

Exactly.  The caller is responsible for /managing/ the memory (or it can 
pass on that responsibility to something else).  malloc and free are 
provide and dispose of memory, they do not manage it.
Re: “The end of software secrecy is almost upon
#385
Author: Lawrence D’Oliveiro
Date: Mon, 26 Oct 2026 21:45
7 lines
2441 bytes
On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:

> Say a lib that has foo_create... Well, the damn called must remember
> to call foo_destroy, right?

Are you backpedalling from your previous idea that the caller must
allocate the memory for the library to use?
Re: “The end of software secrecy is almost upon
#386
Author: Lawrence D’Oliveiro
Date: Mon, 26 Oct 2026 21:45
5 lines
2279 bytes
On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:

> HUH? How do you call say, fread without a user provided buffer?

Relevance being?
Re: “The end of software secrecy is almost upon
#387
Author: Lawrence D’Oliveiro
Date: Mon, 26 Oct 2026 21:46
6 lines
2504 bytes
On Mon, 26 Oct 2026 13:23:59 -0700, Chris M. Thomasson wrote:

> If you need dynamic memory fine.

What the hell do you think we have been talking about this whole
time??
Re: “The end of software secrecy is almost upon
#388
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:47
9 lines
2592 bytes
On 10/26/2026 2:45 PM, Lawrence D’Oliveiro wrote:
> On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote:
> 
>> HUH? How do you call say, fread without a user provided buffer?
> 
> Relevance being?

Ummm... What we were talking about. You snipped a lot. See, the caller 
needs to have the buffer in order to call fread, right?
Re: “The end of software secrecy is almost upon
#389
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:51
19 lines
2979 bytes
On 10/26/2026 2:46 PM, Lawrence D’Oliveiro wrote:
> On Mon, 26 Oct 2026 13:23:59 -0700, Chris M. Thomasson wrote:
> 
>> If you need dynamic memory fine.
> 
> What the hell do you think we have been talking about this whole
> time??

Why do you "seem" to think we "always" need dynamic memory? Then you ask 
this gem:
__________
Does that apply to the caller of library APIs like malloc(3) and
free(3)?
__________

See, the caller is responsible for managing things. Say foo_create that 
succeeds. Well, now the caller must call foo_destroy.

Re: “The end of software secrecy is almost upon
#390
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:53
12 lines
2842 bytes
On 10/26/2026 2:45 PM, Lawrence D’Oliveiro wrote:
> On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:
> 
>> Say a lib that has foo_create... Well, the damn called must remember
>> to call foo_destroy, right?
> 
> Are you backpedalling from your previous idea that the caller must
> allocate the memory for the library to use?

Where did I say must? I said some libs allow the caller to create their 
internal state. You are the one that seems to not understand it? Either 
way, the caller needs to manage things in C. malloc/free, etc.
Re: “The end of software secrecy is almost upon
#391
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:58
24 lines
3277 bytes
On 10/26/2026 2:29 PM, David Brown wrote:
> On 26/10/2026 21:29, Chris M. Thomasson wrote:
>> On 10/25/2026 8:40 PM, Lawrence D’Oliveiro wrote:
>>> On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:
>>>
>>>> Managing the memory is the caller’s job in C anyway.
>>>
>>> Does that apply to the caller of library APIs like malloc(3) and
>>> free(3)?
>>
>> Yes. The caller calls malloc, if it succeeded, the caller needs to 
>> free what it got... Right?
> 
> Exactly.  The caller is responsible for /managing/ the memory (or it can 
> pass on that responsibility to something else).  malloc and free are 
> provide and dispose of memory, they do not manage it.
> 

Right. For instance take my ralloc thing. A user can create a big pile 
of memory, have rallocex carve it up for them (align, etc), and use it. 
But, the user needs to know how to free that memory. If its on the 
stack, well, easy. If not call free, or whatever it needs.

ralloc does not give a crap where the memory came from.
Re: “The end of software secrecy is almost upon us”
#392
Author: Lawrence D’Oliveiro
Date: Mon, 26 Oct 2026 21:59
22 lines
2679 bytes
On Mon, 26 Oct 2026 13:03:25 -0700, Chris M. Thomasson wrote:

> Shared state? Just use memory mapped files. You don't need
> pipes/sockets etc. You need to know how to properly sync things.

Like it or not, the Unix-type model is the closest we have to a
standard set of OS APIs. It’s the only one that starts from an
official spec, namely POSIX.

At one point, Sun did spearhead a campaign to standardize Microsoft
Windows, believe it or not
<https://www.youtube.com/watch?v=H5v0CK249rI> -- but of course
Microsoft successfully stymied that effort.

And as a result of all that past market strategizing, nowadays we have
a multi-decade-long accumulation of Free software that assumes that
basic Unix-type set of APIs, and nothing else is able to come close.
So that is what we expect to have when we start new projects or keep
existing ones going, because nobody wants to reinvent the wheel when
they can build on all the high-quality work that has gone before.

Like it or not, the Unix model has conquered the world.
Re: “The end of software secrecy is almost upon
#393
Author: Lynn McGuire
Date: Mon, 26 Oct 2026 22:08
63 lines
4097 bytes
On 10/23/2026 11:06 AM, Peter Flass wrote:
> On 10/23/26 01:01, boltar@caprica.universe wrote:
>> On Thu, 22 Oct 2026 12:19:49 -0400 (EDT)
>> kludge@panix.com (Scott Dorsey) gabbled:
>>> In article <11bd7tj$rh4f$1@dont-email.me>,  <boltar@battlestar.co.uk> 
>>> wrote:
>>>>
>>>> Most of us have a CS degree. But then we go out into the real world, 
>>>> get a
>>>> job and find out what real programming on real products entails, not 
>>>> a load
>>>> of virtual academic naval gazing.
>>>
>>> That's because it's not a trade school degree.  It's not there to teach
>>> you to program, it's there to teach you the fundamentals that you 
>>> need to
>>> properly understand programming.
>>
>> No, it teaches you fundamentals of certain aspects of computer 
>> paradigms such
>> as databases, graphics, AI. Most people into computers learn actual 
>> programming
>> long before they hit university.
>>
>>> Engineering schools are even more that way.  They don't teach you much
>>> engineering, but they give you all the background that you need to learn
>>> engineering.
>>
>> Programming isn't pure engineering - its a combination of engineering, 
>> logic,
>> art and a trade.
>>
>>> If you just want a job, getting one of these degrees is not for you.  
>>> It's
>>> not there for that.
>>
>> Bill Gates never earned a degree. He seemed to do ok.
> 
>  From what I understand, he wasn't a very good programmer, though.

https://www.joelonsoftware.com/2006/06/16/my-first-billg-review/

"Then I sat down to write the Excel Basic spec, a huge document that 
grew to hundreds of pages. I think it was 500 pages by the time it was 
done. (“Waterfall,” you snicker; yeah yeah shut up.)"

"In my BillG review meeting, the whole reporting hierarchy was there, 
along with their cousins, sisters, and aunts, and a person who came 
along from my team whose whole job during the meeting was to keep an 
accurate count of how many times Bill said the F word. The lower the 
f***-count, the better."

"… and THERE WERE NOTES IN ALL THE MARGINS. ON EVERY PAGE OF THE SPEC. 
HE HAD READ THE WHOLE GODDAMNED THING AND WRITTEN NOTES IN THE MARGINS."

He Read The Whole Thing! [OMG SQUEEE!]

I turned down an unsolicited job at Microsoft in 1987.  In retrospect, 
it may have been a bad decision.  Then again, BillG seems to be a crazy 
overseer from the latest reports.

Lynn
Re: “The end of software secrecy is almost upon
#394
Author: Lawrence D’Oliveiro
Date: Mon, 26 Oct 2026 22:20
18 lines
2938 bytes
On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:

> On 10/26/2026 2:45 PM, Lawrence D’Oliveiro wrote:
>>
>> On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:
>>
>>> Say a lib that has foo_create... Well, the damn called must
>>> remember to call foo_destroy, right?
>>
>> Are you backpedalling from your previous idea that the caller must
>> allocate the memory for the library to use?
>
> Where did I say must?

You said “Managing the memory is the caller’s job in C anyway.” You
didn’t say “could be the caller’s job” as in “the caller could have a
choice”, you said “*is* the caller’s job”. No choice. I.e. the caller
*must* manage memory.
Re: “The end of software secrecy is almost upon
#395
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 22:42
30 lines
3675 bytes
On 10/26/2026 3:20 PM, Lawrence D’Oliveiro wrote:
> On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:
> 
>> On 10/26/2026 2:45 PM, Lawrence D’Oliveiro wrote:
>>>
>>> On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:
>>>
>>>> Say a lib that has foo_create... Well, the damn called must
>>>> remember to call foo_destroy, right?
>>>
>>> Are you backpedalling from your previous idea that the caller must
>>> allocate the memory for the library to use?
>>
>> Where did I say must?
> 
> You said “Managing the memory is the caller’s job in C anyway.” You
> didn’t say “could be the caller’s job” as in “the caller could have a
> choice”, you said “*is* the caller’s job”. No choice. I.e. the caller
> *must* manage memory.

But, the caller must take care in C. Say a lib that allows the caller to 
create their own memory from the requirements reaped from the lib. Okay. 
Fine. Also, take a lib that is more "encapsulated" than say a pure 
foo_create/destroy. The caller must remember to call foo_destroy, right?

Using io_uring is a fun one. The caller created the memory, iirc from 
mmap, so the kernel can use it. The Kernel punts off the lifetime 
management of the users ring buffers.

The C must manage things regardless. say malloc and free?
Re: “The end of software secrecy is almost upon
#397
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 22:46
9 lines
2488 bytes
On 10/25/2026 8:40 PM, Lawrence D’Oliveiro wrote:
> On Sun, 25 Oct 2026 19:21:00 -0700, Chris M. Thomasson wrote:
> 
>> Managing the memory is the caller’s job in C anyway.
> 
> Does that apply to the caller of library APIs like malloc(3) and
> free(3)?

you should print that out and frame it.
Re: “The end of software secrecy is almost upon
#396
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 23:06
36 lines
3655 bytes
On 10/26/2026 3:20 PM, Lawrence D’Oliveiro wrote:
> On Mon, 26 Oct 2026 14:53:48 -0700, Chris M. Thomasson wrote:
> 
>> On 10/26/2026 2:45 PM, Lawrence D’Oliveiro wrote:
>>>
>>> On Mon, 26 Oct 2026 13:33:37 -0700, Chris M. Thomasson wrote:
>>>
>>>> Say a lib that has foo_create... Well, the damn called must
>>>> remember to call foo_destroy, right?
>>>
>>> Are you backpedalling from your previous idea that the caller must
>>> allocate the memory for the library to use?
>>
>> Where did I say must?
> 
> You said “Managing the memory is the caller’s job in C anyway.” You
> didn’t say “could be the caller’s job” as in “the caller could have a
> choice”, you said “*is* the caller’s job”. No choice. I.e. the caller
> *must* manage memory.

A simple pattern... Now, some libs can do it others are simply not 
designed that way.


foo_alloc_req r = foo_query_alloc(&cfg);
void *mem = aligned_alloc(r.align, r.size);      /* once */

for (int i = 0; i < n_jobs; ++i) {
     foo *f = foo_init(mem, r.size, &cfg);        /* build in the same 
block */
     /* ... use f ... */
     foo_deinit(f);                               /* object ends, block 
stays ours */
}

free(mem);                                       /* once, at the very end */
Re: “The end of software secrecy is almost upon
#398
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 02:20
34 lines
3079 bytes
On 10/25/2026 8:56 AM, Scott Lurndal wrote:
> Michael S <already5chosen@yahoo.com> writes:
>> On Sat, 24 Oct 2026 21:24:58 -0000 (UTC)
>> cross@spitfire.i.gajendra.net (Dan Cross) wrote:
>>
> 
>>>
>>> Indeed, but I'm hoping Mr Boltar will chime in with his answers,
>>> so that we can understand why thinks that a language like C
>>> should introduce a *process* model, and how threads are similar.
>>>
>>> 	- Dan C.
>>>
>>
>> First, he was talking about C++. Unlike me, he does not appear to care
>> about C.
>> Second, while in theory threads can be implemented by C++
>> compilers+language  support library, in practice I had never seen it
>> done. All I had seen is C++ threads implemented in library as thin
>> wrapper atop of the OS (or RT executive) implementation.
>> I can not see while the same can't be done for processes, with
>> API modeled on posix_spawn() or Windows CreateProcess().
>> It does not look like variety in this field is bigger than in case of
>> threads. More like it is smaller.
>>
>> Now, would it be the first thing I would want like addition to C++
>> standard library? No it would not be.
>> The first thing would be IPv4 communication, sockets, poll etc...
> 
> For which we, thankfully, have POSIX on most non-windows operating
> systems.

POSIC, bow down, even way before C11. It still can be used, and is very 
nice.
Re: “The end of software secrecy is almost upon
#400
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 02:29
79 lines
5071 bytes
On 10/24/2026 3:43 AM, David Brown wrote:
> On 23/10/2026 18:57, Peter Flass wrote:
>> On 10/23/26 02:45, David Brown wrote:
>>> On 23/10/2026 08:25, Lawrence D’Oliveiro wrote:
>>>> On Thu, 22 Oct 2026 22:29:45 -0700, Chris M. Thomasson wrote:
>>>>
>>>>> On 10/22/2026 8:19 PM, Lawrence D’Oliveiro wrote:
>>>>>>
>>>>>> On Thu, 22 Oct 2026 07:26:21 -0700, Peter Flass wrote:
>>>>>>
>>>>>>> That's why I try to use PL/I AUTOMATIC (stack) storage and not
>>>>>>> allocate a lot of stuff. You need to have a disciplined approach
>>>>>>> if you allocate random stuff here and there.
>>>>>>
>>>>>> What if you’re building an object that needs to be returned to the
>>>>>> caller?
>>>>>
>>>>> Have the caller have the object before hand and call a function to
>>>>> initialize it?
>>>>
>>>> I’m assuming that all that BASIC programming hasn’t got to your head,
>>>> and you’re not serious. ;)
>>>
>>> Chris' wording is perhaps poor, but the principle is right.
>>>
>>> I don't know PL/I or Fortran, but in C if you have :
>>>
>>>      typedef struct data_struct { int a; int xs[20]; } S ;
>>>
>>>      S build_some_data(void) {
>>>          S s;
>>>
>>>          s.a = 123;
>>>          for (int i = 0; i < 20; i++) s.xs[i] = i;
>>>
>>>          return s;
>>>      }
>>>
>>>      void foo() {
>>>          S s = build_some_data();
>>>      }
>>>
>>>
>>> then it is typically handled as though you had written :
>>>
>>>      void build_some_data(S * p) {
>>>          p->a = 123;
>>>          for (int i = 0; i < 20; i++) p->xs[i] = i;
>>>
>>>          return;
>>>      }
>>>
>>>      void foo() {
>>>          S s;
>>>          build_some_data(&s);
>>>      }
>>>
>>>
>>> That is - the caller creates the /space/ for the returned object, but 
>>> does not do any kind of initialisation.  It passes a pointer to that 
>>> space as a hidden parameter to the function that wants to return the 
>>> object.
>>>
>>> That principle should work fine in any language, as long as the size 
>>> of the returned object is known by the caller code.
>>
>> That last sentence is why it would not work fine,
> 
> OK.  Knowing the size of the returned object is an absolute requirement 
> for pre-allocation by the caller, and it is a requirement that is fine 
> for a lot of situations and a lot of languages.  But if it is not the 
> case for PL/I, Fortran, or any other particular language (or particular 
> function in any language), then I fully agree - the object's space can't 
> be handled by the caller.
> 

Use when the API provides it, or else, well, read the api learn and know 
how to use it. If it allows the caller to make the memory it needs, so 
be it, if not, who cares?
Re: “The end of software secrecy is almost upon us”
#399
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 02:43
53 lines
4186 bytes
On 10/24/2026 2:38 PM, Charlie Gibbs wrote:
> On 2026-10-24, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
> 
>> On 10/23/2026 8:44 PM, Lawrence D’Oliveiro wrote:
>>
>>> On Fri, 23 Oct 2026 23:31:41 GMT, Charlie Gibbs wrote:
>>>
>>>> On 2026-10-23, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
>>>>
>>>>> What was that error message? I was expecting something like “DISK
>>>>> ERROR” or “I/O ERROR”. Instead, it said
>>>>>
>>>>>       I’m having trouble with the disk.
>>>>>
>>>>> The idea of an error message phrased in plain, approachable
>>>>> language (using a first-person pronoun, even) instead of technical
>>>>> terms?? That was a revelation.
>>>>
>>>> Unfortunately it's not the kind of revelation I welcome. Back in my
>>>> mainframe days, I learned to hate catch-all error messages; they're
>>>> the sign of a programmer who's too lazy to try to help the user. If
>>>> something goes wrong, I want to be given some clues as to where to
>>>> look. But more and more these days, your typical error message is
>>>> "Something went wrong." Nothing more. This kind of conduct should be
>>>> condemned.
>>>
>>> This was not like that though, was it? On systems of that era, you
>>> would typically get something like “DISK ERROR” or “I/O ERROR”. The
>>> plain-language message was no less specific than that.
>>>
>>> Do you want more detail about what went wrong? Perhaps a CRC
>>> validation failure? Sector-addressing failure? Missing address/data
>>> marks? Invalid GCR/RLL encoding?
>>>
>>> That kind of low-level detail might be helpful to somebody (perhaps a
>>> hardware engineer) trying to fix the problem. And perhaps it should
>>> appear in a system log somewhere.
>>>
>>> And it wouldn’t have mattered much in this case, anyway, since it
>>> would have been obvious to anybody‡ sitting or standing in front of the
>>> machine, that the most likely cause was the fact that there was no
>>> disk in the drive.
>>>
>>> ‡Anybody who had made much use of floppy disks on micros, anyway.
>>
>> Iirc, BASIC had a fun error. I cannot remember the damn exact phrase, it
>> was something like expression too complex or something.
> 
> "Who is General Failure and why is he reading my disk?"
> 

:^() Basically. The BASIC was about too complex, and it was a little odd 
to me.
Re: “The end of software secrecy is almost upon us”
#401
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 02:51
5 lines
2314 bytes
On 10/23/2026 8:39 PM, Lawrence D’Oliveiro wrote:
[...]

I was in the linux world for a whiel, along with solaris, etc. But 
Windows, oh my. vcpkg is a big turn.
Re: “The end of software secrecy is almost upon
#402
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 02:57
9 lines
2691 bytes
On 10/24/2026 3:32 PM, Lawrence D’Oliveiro wrote:
> On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:
> 
>> Or what about miniaudio’s ma_engine_get_heap_size plus
>> ma_engine_init_preallocated
> 
> No idea about that, but the same principle would apply.

You sound like you never worked with any of it before?????
Re: “The end of software secrecy is almost upon
#403
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 03:09
11 lines
2728 bytes
On 10/24/2026 3:32 PM, Lawrence D’Oliveiro wrote:
> On Sat, 24 Oct 2026 13:27:30 -0700, Chris M. Thomasson wrote:
> 
>> Or what about miniaudio’s ma_engine_get_heap_size plus
>> ma_engine_init_preallocated
> 
> No idea about that, but the same principle would apply.

Sure you do, or what are you writing about anyway? Really?

You seem like the oracle, right?
Re: “The end of software secrecy is almost upon
#404
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 03:16
41 lines
3598 bytes
On 10/26/2026 1:09 PM, Michael S wrote:
> On Mon, 26 Oct 2026 10:01:55 -0000 (UTC)
> boltar@caprica.universe wrote:
> 
>> On Sun, 25 Oct 2026 14:19:14 -0700
>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>>> On 10/25/2026 1:34 AM, boltar@caprica.universe wrote:
>>>> On Sat, 24 Oct 2026 13:57:02 -0400 (EDT)
>>>> kludge@panix.com (Scott Dorsey) gabbled:
>>>>> In article <11bif5s$2pam0$1@dont-email.me>,
>>>>> Peter Flass  <Peter@Iron-Spring.com> wrote:
>>>>>> You can have co-operative threads. IBM CICS used to run lots of
>>>>>> threads (tasks) concurrently, and ran them well.
>>>>>
>>>>> When I learned C, there was no threading and there were only
>>>>> different processes, so you had to do a fork and then synchronize
>>>>> with the other process.  This wasn't a dealbreaker and we did
>>>>> plenty of stuff that way, but having threads available was very
>>>>> nice and made for many operations becoming more convenient to
>>>>> write.
>>>>
>>>> Unfortunately most win32 programmers don't really understand
>>>> multiprocess programming because the w32 API is so borked so use
>>>> threads even when seperate process would be more appropriate.
>>>>
>>>>    
>>>
>>> Windows has what we need to run multi process. Even for a Mutex...
>>> Remember WAIT_ABANDONED?
>>
>> win32 can't do fork() making it effectively a totally useless API for
>> a lot of multiprocess development. Creating a brand new process is
>> fine if you don't need any complicated shared state such as when
>> kicking off something on the command line or creating a pipe
>> (something else win32 is shit at) but thats about it.
>>
> 
> You are clueless about Windows. That's o.k.
> Your pretense that you know something about it is not o.k.
> In that regard you are not better than LDO.
Seems so! Damn it.
Re: “The end of software secrecy is almost upon
#405
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 03:44
84 lines
5552 bytes
On 10/25/2026 2:45 AM, David Brown wrote:
> On 25/10/2026 00:11, Michael S wrote:
>> On Sat, 24 Oct 2026 21:24:58 -0000 (UTC)
>> cross@spitfire.i.gajendra.net (Dan Cross) wrote:
>>
>>> In article <11bj08r$309uk$1@dont-email.me>,
>>> Peter Flass  <Peter@Iron-Spring.com> wrote:
>>>> On 10/24/26 09:41, Dan Cross wrote:
>>>>> In article <11bhppd$2lpkc$1@dont-email.me>,
>>>>> <boltar@caprica.universe> wrote:
>>>>>> On Fri, 23 Oct 2026 20:45:27 -0000 (UTC)
>>>>>> cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>>>>>> In article <11bf4d1$skul$1@dont-email.me>,
>>>>>>> <boltar@caprica.universe> wrote:
>>>>>>>> On Thu, 22 Oct 2026 16:22:30 -0000 (UTC)
>>>>>>>> cross@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>>>>>>>> In article <11bd7rg$2cvfs$1@dont-email.me>,
>>>>>>>>> <boltar@battlestar.co.uk> wrote:
>>>>>>>>>> You need an OS to do threading properly too. Theres a reason
>>>>>>>>>> green threads in java were a joke.
>>>>>>>>>
>>>>>>>>> Weird that you think you need a operating system for threads,
>>>>>>>>> yet you want C to standardize processes which also ... need an
>>>>>>>>> operating system.  I mean, POSIX already does an ok job of
>>>>>>>>> standardizing the sorts of process-y things you would expect
>>>>>>>>> from, you know, an operating system.
>>>>>>>>
>>>>>>>> I'm simply pointing out the inconsistency in having a threading
>>>>>>>> library but not a process library. Its perfectly possible to
>>>>>>>> simulate a multiprocess enviroment.
>>>>>>>
>>>>>>> So write a simulator in your language of choice.  You don't need
>>>>>>> the language to standardize a process model for that.
>>>>>>
>>>>>> Ditto threads. So why does C++ have a threading library?
>>>>>>
>>>>>> Take your time...
>>>>>
>>>>> What, pray tell, do you think that a _thread_ is?  And how is it
>>>>> different from a _process_?  For that matter, what do you think
>>>>> that a _process_ is?
>>>>>
>>>>> Please, take all the time you need to answer.
>>>>
>>>> Threads share resources such as address space, files, etc. A process
>>>> runs in its own address space. (at least these days, before virtual
>>>> memory, who knows?)
>>>
>>> Indeed, but I'm hoping Mr Boltar will chime in with his answers,
>>> so that we can understand why thinks that a language like C
>>> should introduce a *process* model, and how threads are similar.
>>>
>>>     - Dan C.
>>>
>>
>> First, he was talking about C++. Unlike me, he does not appear to care
>> about C.
>> Second, while in theory threads can be implemented by C++
>> compilers+language  support library, in practice I had never seen it
>> done. All I had seen is C++ threads implemented in library as thin
>> wrapper atop of the OS (or RT executive) implementation.
>> I can not see while the same can't be done for processes, with
>> API modeled on posix_spawn() or Windows CreateProcess().
>> It does not look like variety in this field is bigger than in case of
>> threads. More like it is smaller.
>>
> 
> No one is suggesting that the threads themselves are implemented in 
> pure, standard, portable C++.  You need an underlying OS or support of 
> some sort if you are going to have preemptable threads.  It's the same 
> principle as IO and file access.
> 
> But the difference between threads and processes is very simple from the 
> viewpoint of C and C++.  Suppose you have a global (i.e., external 
> linkage) variable :
> 
>      int x;
> 
> Two threads that have "int a = x;" see the same "x" (ignoring data races 
> and synchronisation).  Two processes see completely different "x".[...]

Bingo. So, trying to imply that system is something okay for multi 
process, well, good luck. Daft. C/C++ has no std way to deal with multi 
process. But, we can use C/C++ to program for it all day long. Interesting.
Page 8 of 11 • 514 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads