Thread View: comp.lang.c++
529 messages
529 total messages
Page 9 of 11
Started by Lynn McGuire
Wed, 14 Oct 2026 04:18
Page 9 of 11 • 529 total messages
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 03:44
Date: Tue, 27 Oct 2026 03:44
84 lines
5403 bytes
5403 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.
Re: “The end of software secrecy is almost upon us”
Author: Lawrence D’Oliveiro
Date: Tue, 27 Oct 2026 05:56
Date: Tue, 27 Oct 2026 05:56
43 lines
3829 bytes
3829 bytes
On Mon, 26 Oct 2026 19:51:23 -0700, Chris M. Thomasson wrote: > On 10/23/2026 8:39 PM, Lawrence D’Oliveiro wrote: >> >> On Fri, 23 Oct 2026 16:58:04 -0700, Chris M. Thomasson wrote: >>> >>> Keeping them up to date is, afaict, manual. >> >> In the Linux world, we have “development” packages versus “runtime” >> packages. >> >> The development package contains the source includes, pkg-config >> info etc. The runtime version includes the actual shared library. >> So your built package has a dependency on the latter; when a user >> tries to install your package, it should automatically pull in the >> latter as necessary. >> >> Example from my system: >> >> lrwxrwxrwx 1 root root 13 Apr 24 2026 /usr/lib/x86_64-linux-gnu/libcairo.so -> libcairo.so.2 >> lrwxrwxrwx 1 root root 21 Apr 24 2026 /usr/lib/x86_64-linux-gnu/libcairo.so.2 -> libcairo.so.2.11804.4 >> -rw-r--r-- 1 root root 1366728 Apr 24 2026 /usr/lib/x86_64-linux-gnu/libcairo.so.2.11804.4 >> >> Where did these come from? >> >> root@theon:~ # dpkg-query -S /usr/lib/x86_64-linux-gnu/libcairo.so.2 >> libcairo2:amd64: /usr/lib/x86_64-linux-gnu/libcairo.so.2 >> >> root@theon:~ # dpkg-query -S /usr/lib/x86_64-linux-gnu/libcairo.so >> libcairo2-dev:amd64: /usr/lib/x86_64-linux-gnu/libcairo.so >> >> Notice how the development library is not versioned, but is just a >> symlink to a versioned library. >> >> The runtime library is always versioned. This allows multiple >> versions of the library to be present at once, with some older >> packages, that haven’t been rebuilt, still depending on an older >> version, while up-to-date packages make use of the newer version. > > I was in the linux world for a whiel, along with solaris, etc. But > Windows, oh my. vcpkg is a big turn. Windows isn’t even in the same league, is it.
Re: Threads and processes (Re: “The end of software secrecy is almost upon)
Author: Lawrence D’Oliveiro
Date: Tue, 27 Oct 2026 06:08
Date: Tue, 27 Oct 2026 06:08
45 lines
3520 bytes
3520 bytes
On Mon, 26 Oct 2026 19:14:57 -0700, Lars Poulsen wrote: > Processes are almost self-contained virtual machines. Unix has one > of the cleanest implementations around, and the fork() system call > combined with copy-on-write is very elegant. None of the other > operating system I have worked with have anything remotely like it. > VMS was also quite elegant, but so different that I think it would > be impossible to simulate one on the other (in either direction). Remember that copy-on-write was a later addition. Early Unix systems had much more primitive memory management than VMS. But they did catch up. VMS had this odd distinction between “subprocesses” and “detached processes”. You didn’t need special privilege to create the former (though it was limited by a process quota), but you did for the latter. And there were the idiosyncrasies of the “UIC” business, which were a hangover from RSX-11. Why were login processes initially created under a UIC of [10,40]? (In octal, no less.) The one clever thing about VMS that I miss most on Linux systems was the terminal driver. The functionality of that was a wonder to behold. > Threads are much simpler. Multiple strands of execution in a shared > address space. All the language needs to do is provide one shared > vocabulary to allow code portability. There are some gotchas. Threads can be a notorious source of hard-to-find bugs. Note how the POSIX spec defines “cancellation points”, which are a detailed list of system service/userland API calls where the thread could potentially get force-terminated on request from another process thread, as opposed to having it happen at any time. > To me it is obvious that threads can and should be standardized, while > processes are generally not portable. What about a system like Linux, where the two are really just points on a spectrum of possibilities? <https://manpages.debian.org/clone(2)> is the underlying common kernel call that is used to implement both fork(2) and pthread_create(3) on Linux.
Re: “The end of software secrecy is almost upon
Author: David Brown
Date: Tue, 27 Oct 2026 08:06
Date: Tue, 27 Oct 2026 08:06
44 lines
3846 bytes
3846 bytes
On 27/10/2026 04:44, Chris M. Thomasson wrote: > On 10/25/2026 2:45 AM, David Brown wrote: >> 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. There are, of course, languages and runtime systems that handle processes too. An obvious example is Python. But it does it using a significantly "thicker" abstraction layer, combined with a significant run-time system to manage it all. And as a programmer, you have to be aware that you can't access global data from different processes, in the way you can do from different threads - you can only use data that is explicitly shared, or of appropriate data structures (like the process-aware queues). Behind the scenes, there is a lot of work to pass and synchronise all this using named pipes, memmapped shared files, etc. While C++ programmers are used to there being a certain degree of "hidden work" (unlike in C, where work is much more explicit), this kind of thing is not at all a match for the C++ philosophy. And there are languages like Erlang that divide everything into micro-processes, and use the same mechanisms for controlling and passing data around regardless of whether this little processes are in the same thread, or different threads, different OS processes, or different computers. That works because there are very narrow and tightly controlled mechanisms for sharing data. Note that these are both languages that run on a VM, not compiled languages.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Tue, 27 Oct 2026 08:22
Date: Tue, 27 Oct 2026 08:22
59 lines
4330 bytes
4330 bytes
On Tue, 27 Oct 2026 09:06:26 +0100 David Brown <david.brown@hesbynett.no> wrote: > On 27/10/2026 04:44, Chris M. Thomasson wrote: > > On 10/25/2026 2:45 AM, David Brown wrote: > > >> 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. > > There are, of course, languages and runtime systems that handle > processes too. An obvious example is Python. But it does it using a > significantly "thicker" abstraction layer, combined with a > significant run-time system to manage it all. And as a programmer, > you have to be aware that you can't access global data from different > processes, in the way you can do from different threads - you can > only use data that is explicitly shared, or of appropriate data > structures (like the process-aware queues). Behind the scenes, there > is a lot of work to pass and synchronise all this using named pipes, > memmapped shared files, etc. While C++ programmers are used to there > being a certain degree of "hidden work" (unlike in C, where work is > much more explicit), this kind of thing is not at all a match for the > C++ philosophy. > > And there are languages like Erlang that divide everything into > micro-processes, and use the same mechanisms for controlling and > passing data around regardless of whether this little processes are > in the same thread, or different threads, different OS processes, or > different computers. That works because there are very narrow and > tightly controlled mechanisms for sharing data. > > Note that these are both languages that run on a VM, not compiled > languages. > What you wrote about Erlang resembles MPI, which of course is readily available for many compiled or jitted languages, including Fortran, C and C++. I tried to utilize MPI 20 years ago, but the thinking behind it is to different from mine, so I ran away in horror.
Re: “The end of software secrecy is almost upon
Author: Dan Cross
Date: Tue, 27 Oct 2026 10:40
Date: Tue, 27 Oct 2026 10:40
41 lines
2933 bytes
2933 bytes
In article <20261027102255.00006052@yahoo.com>, Michael S <already5chosen@yahoo.com> wrote: >On Tue, 27 Oct 2026 09:06:26 +0100 >David Brown <david.brown@hesbynett.no> wrote: >> [snip] >> And there are languages like Erlang that divide everything into >> micro-processes, and use the same mechanisms for controlling and >> passing data around regardless of whether this little processes are >> in the same thread, or different threads, different OS processes, or >> different computers. That works because there are very narrow and >> tightly controlled mechanisms for sharing data. >> >> Note that these are both languages that run on a VM, not compiled >> languages. > >What you wrote about Erlang resembles MPI, which of course is readily >available for many compiled or jitted languages, including Fortran, C >and C++. >I tried to utilize MPI 20 years ago, but the thinking behind it is to >different from mine, so I ran away in horror. Erlang uses the "actor" model to represent concurrency; state is held by each actor, and actors communicate via message passing, potentially changing state in response to messages. This is a model for _concurrency_, in which multiple independent threads of execution are coordinated to some in a single system. One may think of MPI-style systems this way, but there's a subtle distinction. The typical use case for something like MPI is _parallel_ computation of a numerically intensive problem, where "neighbors" nodes need to occasionally share state; this is usually about _parallelism_; that is, simultaneity. While a concurrency primitive is _necessary_ to think about parallelism (and MPI can be used in that fashion), the two are distinct concepts that are often conflated. To paraphrase Rob Pike on it, concurrency is about dealing with multiple things at once, while parallelism is about doing lots of things at the same time. - Dan C.
Re: “The end of software secrecy is almost upon
Author: James Kuyper
Date: Tue, 27 Oct 2026 15:00
Date: Tue, 27 Oct 2026 15:00
24 lines
3231 bytes
3231 bytes
On 2026-10-26 17:45, Lawrence D’Oliveiro wrote: > On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote: [restore snippage]>> On 2026-10-25 23:39, 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? > > Relevance being? fread() uses a caller-provided buffer, which, according to your previous comment, "push[es] the burden onto all the client code, each one of which has to solve it for itself", so according to you, "That's a dumb way to design things"..If that isn't your actual opinion of fread(), your comments need to be at least a little more nuanced to avoid applying to fread().
Re: “The end of software secrecy is almost upon
Author: Scott Lurndal
Date: Tue, 27 Oct 2026 15:03
Date: Tue, 27 Oct 2026 15:03
43 lines
3046 bytes
3046 bytes
cross@spitfire.i.gajendra.net (Dan Cross) writes: >In article <20261027102255.00006052@yahoo.com>, >Michael S <already5chosen@yahoo.com> wrote: >>On Tue, 27 Oct 2026 09:06:26 +0100 >>David Brown <david.brown@hesbynett.no> wrote: >>> [snip] >>> And there are languages like Erlang that divide everything into >>> micro-processes, and use the same mechanisms for controlling and >>> passing data around regardless of whether this little processes are >>> in the same thread, or different threads, different OS processes, or >>> different computers. That works because there are very narrow and >>> tightly controlled mechanisms for sharing data. >>> >>> Note that these are both languages that run on a VM, not compiled >>> languages. >> >>What you wrote about Erlang resembles MPI, which of course is readily >>available for many compiled or jitted languages, including Fortran, C >>and C++. >>I tried to utilize MPI 20 years ago, but the thinking behind it is to >>different from mine, so I ran away in horror. > >Erlang uses the "actor" model to represent concurrency; state is >held by each actor, and actors communicate via message passing, >potentially changing state in response to messages. This is a >model for _concurrency_, in which multiple independent threads >of execution are coordinated to some in a single system. Chorus (the microkernel) worked in a similar fashion. The microkernel coordinated between actors using message passing. The actors implemented the higher level operating system functionality. The Amadeus project, for example, implemented a version of unix on top of the microkernel using message passing between actors (The Object manager handled files and filesystems, the Process actor handled the POSIX process and thread (SVR4.2ES/MP threads) interfaces including fork, and light-weight processes that implemented threads, and the Streams actor provide system V streams support and networking. Unisys released the OS as part of their massively parallel OPUS computer system.
Re: “The end of software secrecy is almost upon
Author: Peter Flass
Date: Tue, 27 Oct 2026 16:41
Date: Tue, 27 Oct 2026 16:41
30 lines
3562 bytes
3562 bytes
On 10/27/26 08:00, James Kuyper wrote: > On 2026-10-26 17:45, Lawrence D’Oliveiro wrote: >> On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote: > [restore snippage]>> On 2026-10-25 23:39, 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? >> >> Relevance being? > > fread() uses a caller-provided buffer, which, according to your previous > comment, "push[es] the burden onto all the client code, each one of > which has to solve it for itself", so according to you, "That's a dumb > way to design things"..If that isn't your actual opinion of fread(), > your comments need to be at least a little more nuanced to avoid > applying to fread(). The difference is that the size of the buffer for fread() is the maximum you want/expect to read. The size of an object is the size it is, not necessarily what you expect. If you don't provide enough space you will truncate.
Re: Re: “The end of software secrecy is almost upon
Author: Scott Lurndal
Date: Tue, 27 Oct 2026 18:36
Date: Tue, 27 Oct 2026 18:36
38 lines
3132 bytes
3132 bytes
Peter Flass <Peter@Iron-Spring.com> writes: >On 10/27/26 08:00, James Kuyper wrote: >> On 2026-10-26 17:45, Lawrence D’Oliveiro wrote: >>> On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote: >> [restore snippage]>> On 2026-10-25 23:39, 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? >>> >>> Relevance being? >> >> fread() uses a caller-provided buffer, which, according to your previous >> comment, "push[es] the burden onto all the client code, each one of >> which has to solve it for itself", so according to you, "That's a dumb >> way to design things"..If that isn't your actual opinion of fread(), >> your comments need to be at least a little more nuanced to avoid >> applying to fread(). > >The difference is that the size of the buffer for fread() is the maximum >you want/expect to read. The size of an object is the size it is, not >necessarily what you expect. If you don't provide enough space you will >truncate. Which isn't a significant issue with fread, since the underlying stdio buffer (or kernel file cache or terminal driver buffer) will hold the unread information for the next call to fread. fread(3) is basically obsolete for most high-performance applications which map the file directly into the process address space (mmap).
Re: “The end of software secrecy is almost upon
Author: Lawrence D’Oliveiro
Date: Tue, 27 Oct 2026 22:22
Date: Tue, 27 Oct 2026 22:22
37 lines
3664 bytes
3664 bytes
On Tue, 27 Oct 2026 11:00:08 -0400, James Kuyper wrote: > On 2026-10-26 17:45, Lawrence D’Oliveiro wrote: >> >> On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote: >>> >>> On 2026-10-25 23:39, 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? >> >> Relevance being? > > fread() uses a caller-provided buffer, which, according to your previous > comment, "push[es] the burden onto all the client code, each one of > which has to solve it for itself", so according to you, "That's a dumb > way to design things".. Not even paying attention to what’s being said in the parts you quoted, never mind the parts you didn’t. Note my remark above about “solving the resource allocation problem”; elsewhere I asked: “What if you’re building an object that needs to be returned to the caller?” Not clear yet what we’re talking about here? We’re not talking about random API calls, we’re talking about libraries that need to create and manage abstract objects that encapsulate the function they are providing!
Re: “The end of software secrecy is almost upon
Author: James Kuyper
Date: Wed, 28 Oct 2026 01:35
Date: Wed, 28 Oct 2026 01:35
63 lines
5004 bytes
5004 bytes
Thanks to my killfile, I don't see messages posted by Chris M. Thomasson, just other people's responses to them. > On 2026-10-25 20:42, Lawrence D’Oliveiro wrote: >> On Sun, 25 Oct 2026 16:16:26 -0700, Chris M. Thomasson wrote: >> >>> Even analogous, to say, an API that says read n bytes and store into >>> buffer. Well, the caller has lifetime of said buffer. The caller makes >>> the buffer, calls into the function. >> >> So how is the caller supposed to manage that memory? That's the oldest message I can find on this sub-thread, and also the very last message I can find preceding the one quoted below, and it's clearly describing an fread()-like interface, not a function that returns objects of sizes unknown to the caller. If the messages I don't see gave some other context to this sub-thread, I had no way of knowing about it. On 2026-10-27 18:22, Lawrence D’Oliveiro wrote: > On Tue, 27 Oct 2026 11:00:08 -0400, James Kuyper wrote: > >> On 2026-10-26 17:45, Lawrence D’Oliveiro wrote: >>> >>> On Mon, 26 Oct 2026 13:26:38 -0700, Chris M. Thomasson wrote: >>>> >>>> On 2026-10-25 23:39, 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? >>> >>> Relevance being? >> >> fread() uses a caller-provided buffer, which, according to your previous >> comment, "push[es] the burden onto all the client code, each one of >> which has to solve it for itself", so according to you, "That's a dumb >> way to design things".. > > Not even paying attention to what’s being said in the parts you > quoted, never mind the parts you didn’t. Note my remark above about > “solving the resource allocation problem”; elsewhere I asked: “What if > you’re building an object that needs to be returned to the caller?” Yes, and without the context that applies elsewhere, your comment about resource allocation comes off as a non-sequitur. > Not clear yet what we’re talking about here? We’re not talking about > random API calls, we’re talking about libraries that need to create > and manage abstract objects that encapsulate the function they are > providing! I can find no mention of that topic anywhere on this sub-thread. It might be in the parts of Chris's messages that I didn't see and you didn't quote.
Re: “The end of software secrecy is almost upon
Author: Lawrence D’Oliveiro
Date: Wed, 28 Oct 2026 01:43
Date: Wed, 28 Oct 2026 01:43
33 lines
3525 bytes
3525 bytes
On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote:
> ... without the context that applies elsewhere, your comment about
> resource allocation comes off as a non-sequitur.
That’s just an excuse. Other comments of mine, from further back in
this particular line of this thread:
* “What if you’re building an object that needs to be returned to the
caller?”
* “The principle applies to Fortran as it does to any language where
you have to explicitly manage storage allocations.”
* “If you have to do cleanup at each level before exiting, then it works
perfectly well.”
Did you notice any of that?
From elsewhere in the discussion:
I find the C code I write tends to do a lot of dynamic resource
allocations. These can sometimes fail with errors. So error
recovery will invariably involve cleaning up those parts of the
allocations which already succeeded. Gotos are no good for this;
you need to exit levels of structure nesting one by one, disposing
of allocations as you go.
I put together an example here
<https://gitlab.com/ldo/a_structured_discipline_of_programming>.
This is an extension module that offers services to Python code,
because that is just about the worst example I could think of, for
those who think gotos can cut it.
Did you pay attention to any of that?
Re: “The end of software secrecy is almost upon
Author: James Kuyper
Date: Wed, 28 Oct 2026 02:18
Date: Wed, 28 Oct 2026 02:18
32 lines
3930 bytes
3930 bytes
On 2026-10-27 21:43, Lawrence D’Oliveiro wrote: > On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote: > >> ... without the context that applies elsewhere, your comment about >> resource allocation comes off as a non-sequitur. > > That’s just an excuse. Other comments of mine, from further back in > this particular line of this thread: > > * “What if you’re building an object that needs to be returned to the > caller?” > * “The principle applies to Fortran as it does to any language where > you have to explicitly manage storage allocations.” > * “If you have to do cleanup at each level before exiting, then it works > perfectly well.” > > Did you notice any of that? No, none of those comments appear anywhere in this sub-thread as displayed by Thunderbird. How do they fit in to the sequence of messages that lead to this one? If they appeared in some other sub-thread, that's not relevant; the fact that something is being discussed in another sub-thread doesn't make it relevant to what's being discussed in this one. However, if those comments occur in Chris' text that I never saw, or in messages on this sub-thread that are prior to the earliest one I quoted, then they would be relevant. The references for the oldest message I quoted indicate that there were 20 previous ones in that sub-thread, but they don't display as predecessors of that message. This is a common problem when I filter out all the messages posted by someone. If that person is a significant contributor to a particular thread, that thread gets chopped up into pieces and Thunderbird fails to notice that those pieces are related to each other.
Re: “The end of software secrecy is almost upon
Author: Peter Flass
Date: Wed, 28 Oct 2026 02:28
Date: Wed, 28 Oct 2026 02:28
38 lines
3861 bytes
3861 bytes
On 10/27/26 18:43, Lawrence D’Oliveiro wrote: > On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote: > >> ... without the context that applies elsewhere, your comment about >> resource allocation comes off as a non-sequitur. > > That’s just an excuse. Other comments of mine, from further back in > this particular line of this thread: > > * “What if you’re building an object that needs to be returned to the > caller?” > * “The principle applies to Fortran as it does to any language where > you have to explicitly manage storage allocations.” > * “If you have to do cleanup at each level before exiting, then it works > perfectly well.” > > Did you notice any of that? > > From elsewhere in the discussion: > > I find the C code I write tends to do a lot of dynamic resource > allocations. These can sometimes fail with errors. So error > recovery will invariably involve cleaning up those parts of the > allocations which already succeeded. Gotos are no good for this; > you need to exit levels of structure nesting one by one, disposing > of allocations as you go. > > I put together an example here > <https://gitlab.com/ldo/a_structured_discipline_of_programming>. > This is an extension module that offers services to Python code, > because that is just about the worst example I could think of, for > those who think gotos can cut it. > > Did you pay attention to any of that? You could keep track of the allocations in a list (or whatever) and then walk thru and clean them up at once.
Re: Re: “The end of software secrecy is almost upon
Author: boltar
Date: Wed, 28 Oct 2026 08:57
Date: Wed, 28 Oct 2026 08:57
23 lines
2259 bytes
2259 bytes
On Mon, 26 Oct 2026 13:10:46 -0600 Blaine <cactus_DAC@yahoo.com> gabbled: >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. Thats your problem, not mine.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Wed, 28 Oct 2026 08:58
Date: Wed, 28 Oct 2026 08:58
37 lines
2746 bytes
2746 bytes
On Mon, 26 Oct 2026 21:45:17 +0200 Michael S <already5chosen@yahoo.com> gabbled: >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. And unix got pthreads in 1995. Windows a decade late as usual. >> 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. Fine, most people will never use it, but for certain things its vital.
Re: Re: “The end of software secrecy is almost upon
Author: boltar
Date: Wed, 28 Oct 2026 09:01
Date: Wed, 28 Oct 2026 09:01
23 lines
2550 bytes
2550 bytes
On Mon, 26 Oct 2026 13:03:25 -0700 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >On 10/26/2026 3:01 AM, boltar@caprica.universe wrote: >> 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. Oh really? So you receive an incoming connection to a socket via an accept() call. In unix you can fork() at that point so the connecting client has a server process all to itself with all the state instantly copied from the parent process. HOw do you mimic that in windows? Start the server process from scratch and pass it a ton of state via the command line or using some roll-your-own shared memory nonsense? Give me a break. I guess in windows it spawns a thread leading to the issue of a single thread crashing bringing down the entire application - something multiprocess completely avoids.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Wed, 28 Oct 2026 09:06
Date: Wed, 28 Oct 2026 09:06
25 lines
2371 bytes
2371 bytes
On Mon, 26 Oct 2026 22:04:33 +0200 Michael S <already5chosen@yahoo.com> gabbled: >On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) >boltar@caprica.universe wrote: >> Go ahead and remain clueless. >> > > >system() can do most of the same things as spawn() family. Rubbish, you clearly didn't bother to spend 2 mins googling. >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?" The problem with system is its fire and forget - all you can do with it is collect its exit code when its done. You can't communicate with it via pipes, you can't control it via signals (well, not easily), you can't set its process group, tty and on and on. Oh, and it also fires up the default shell to do the actual execution making it hideously inefficient. No serious unix dev uses system() unless thay have absolutely no choice or it really is a case of "go run this, I don't care what happens".
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Wed, 28 Oct 2026 09:08
Date: Wed, 28 Oct 2026 09:08
18 lines
2202 bytes
2202 bytes
On Mon, 26 Oct 2026 22:09:01 +0200 Michael S <already5chosen@yahoo.com> gabbled: >On Mon, 26 Oct 2026 10:01:55 -0000 (UTC) >boltar@caprica.universe wrote: >> 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. OK, whats the windows API call thats the equivalent of fork()? I'm not talking about CreateProcessA() which doesn't even come close.
Re: what's a process, was The end of software secrecy is almost
Author: boltar
Date: Wed, 28 Oct 2026 09:09
Date: Wed, 28 Oct 2026 09:09
13 lines
1864 bytes
1864 bytes
On Mon, 26 Oct 2026 13:19:14 -0700 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >On 10/26/2026 9:19 AM, boltar@caprica.universe wrote: >> I'd be interested how you'd implement fork() using that method given you >> need to copy the state of all file descriptors, heap, stack and global >> memory, current working directory, enviroment variables and a ton of other >> things I can't remember without googling. >> > >Why even do that? Sigh. Why don't you go and find out and educate yourself.
Re: “The end of software secrecy is almost upon
Author: Blaine
Date: Wed, 28 Oct 2026 14:39
Date: Wed, 28 Oct 2026 14:39
32 lines
2856 bytes
2856 bytes
boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 13:10:46 -0600 > Blaine <cactus_DAC@yahoo.com> gabbled: >> 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. > > Thats your problem, not mine. > I'm sorry you are unable to do a better job. Oh well, you just suck and can't do any better, so it's on me. -- Sometimes I just feel like I need to get away A place where I can be by myself, all alone I kinda lay down in the back yard Watch the leaves fall down on my face
Re: “The end of software secrecy is almost upon
Author: Blaine
Date: Wed, 28 Oct 2026 15:47
Date: Wed, 28 Oct 2026 15:47
36 lines
3181 bytes
3181 bytes
boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 13:03:25 -0700 > "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >> On 10/26/2026 3:01 AM, boltar@caprica.universe wrote: >>> 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. > > Oh really? So you receive an incoming connection to a socket via an > accept() > call. In unix you can fork() at that point so the connecting client has a > server process all to itself with all the state instantly copied from the > parent process. HOw do you mimic that in windows? Start the server process > from scratch and pass it a ton of state via the command line or using some > roll-your-own shared memory nonsense? Give me a break. I guess in > windows it > spawns a thread leading to the issue of a single thread crashing > bringing down > the entire application - something multiprocess completely avoids. > Innocent like a lamb for me. Just make a call to malloc() and probe the GarbageCollector. You've got it all wrong, stupid. -- Sometimes I just feel like I need to get away A place where I can be by myself, all alone I kinda lay down in the back yard Watch the leaves fall down on my face
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Wed, 28 Oct 2026 19:47
Date: Wed, 28 Oct 2026 19:47
56 lines
3528 bytes
3528 bytes
On Wed, 28 Oct 2026 09:06:47 -0000 (UTC) boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 22:04:33 +0200 > Michael S <already5chosen@yahoo.com> gabbled: > >On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) > >boltar@caprica.universe wrote: > >> Go ahead and remain clueless. > >> > > > > > >system() can do most of the same things as spawn() family. > > Rubbish, you clearly didn't bother to spend 2 mins googling. > > >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?" > > The problem with system is its fire and forget - all you can do with > it is collect its exit code when its done. You can't communicate with > it via pipes, you can't control it via signals (well, not easily), > you can't set its process group, tty and on and on. Actually, if you are creative enough you can do most of the above-mentioned things. Of course, what you can and what you can't do depends on capabilities of your default shell. And of course the way by which you achieve your goals via system() is VERY OS-dependent. > Oh, and it also > fires up the default shell to do the actual execution making it > hideously inefficient. It matters only when the work delegated to sub-process is both brief and done very often. > No serious unix dev uses system() unless thay > have absolutely no choice or it really is a case of "go run this, I > don't care what happens". > I can't argue about it. Supposedly, it depends on definition of "serious unix dev". In my book, serious dev is one who knows to peek correctly-sized tool to the job rather than one who always uses the most efficient tool. But that's is off topic. Pay attention that I agree with you that system() is not suitable as The Only standard way of support of multiple processes in C++ standard library, even if my reasons for that are different from yours.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Wed, 28 Oct 2026 20:05
Date: Wed, 28 Oct 2026 20:05
35 lines
3177 bytes
3177 bytes
On Wed, 28 Oct 2026 09:08:44 -0000 (UTC) boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 22:09:01 +0200 > Michael S <already5chosen@yahoo.com> gabbled: > >On Mon, 26 Oct 2026 10:01:55 -0000 (UTC) > >boltar@caprica.universe wrote: > >> 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. > > OK, whats the windows API call thats the equivalent of fork()? I'm not > talking about CreateProcessA() which doesn't even come close. > There is no equivalent for fork(). But nearly all things that Posix devs achieve by fork() followed by one or another magic incantation and then followed by exec() can be achived on Windows as well, typically by means of one or another magic flag in parameters of CreateProcess or of one of it's more complicated cousins (CreateProcessAsUser, CreateProcessWithLogon, CreateProcessWithToken, may be others). These things never fascinated me, so I am not an expert. Now, there were cases where Unix programmers used fork() without following it by exec(), but I would think that in the recent 25-30 years such programming patterns are discouraged in favor of threads.
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 21:04
Date: Wed, 28 Oct 2026 21:04
40 lines
3170 bytes
3170 bytes
On 10/28/2026 2:01 AM, boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 13:03:25 -0700 > "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >> On 10/26/2026 3:01 AM, boltar@caprica.universe wrote: >>> 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. > > Oh really? So you receive an incoming connection to a socket via an > accept() > call. In unix you can fork() at that point so the connecting client has a > server process all to itself with all the state instantly copied from the > parent process. HOw do you mimic that in windows? Start the server process > from scratch and pass it a ton of state via the command line or using some > roll-your-own shared memory nonsense? Give me a break. I guess in > windows it > spawns a thread leading to the issue of a single thread crashing > bringing down > the entire application - something multiprocess completely avoids. > On Windows? Get used to https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsaduplicatesocketa DuplicateHandle etc... You can have multiple multi threaded processes on windows. Even ones with multiple fibers running on the multiple threads per process.
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 21:05
Date: Wed, 28 Oct 2026 21:05
40 lines
3136 bytes
3136 bytes
On 10/28/2026 1:58 AM, boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 21:45:17 +0200 > Michael S <already5chosen@yahoo.com> gabbled: >> 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. > > And unix got pthreads in 1995. Windows a decade late as usual. > >>> 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. > > Fine, most people will never use it, but for certain things its vital. > Its simple, if you don't like windows, do use the damn pile.
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 21:06
Date: Wed, 28 Oct 2026 21:06
42 lines
3301 bytes
3301 bytes
On 10/28/2026 2:05 PM, Chris M. Thomasson wrote: > On 10/28/2026 1:58 AM, boltar@caprica.universe wrote: >> On Mon, 26 Oct 2026 21:45:17 +0200 >> Michael S <already5chosen@yahoo.com> gabbled: >>> 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. >> >> And unix got pthreads in 1995. Windows a decade late as usual. >> >>>> 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. >> >> Fine, most people will never use it, but for certain things its vital. >> > > Its simple, if you don't like windows, do use the damn pile. Argh! Damn typos! Don't use the damn pile! :^)
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 21:09
Date: Wed, 28 Oct 2026 21:09
29 lines
2799 bytes
2799 bytes
On 10/28/2026 2:06 AM, boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 22:04:33 +0200 > Michael S <already5chosen@yahoo.com> gabbled: >> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) >> boltar@caprica.universe wrote: >>> Go ahead and remain clueless. >>> >> >> >> system() can do most of the same things as spawn() family. > > Rubbish, you clearly didn't bother to spend 2 mins googling. > >> 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?" > > The problem with system is its fire and forget - all you can do with it is > collect its exit code when its done. You can't communicate with it via > pipes, you can't control it via signals (well, not easily), you can't set its > process group, tty and on and on. Oh, and it also fires up the default shell to > do the actual execution making it hideously inefficient. No serious unix dev > uses system() unless thay have absolutely no choice or it really is a case of > "go run this, I don't care what happens". > > Right. std::system, at least when I use it, makes the caller block until the process is done.
Re: what's a process, was The end of software secrecy is almost
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 21:10
Date: Wed, 28 Oct 2026 21:10
17 lines
2236 bytes
2236 bytes
On 10/28/2026 2:09 AM, boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 13:19:14 -0700 > "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >> On 10/26/2026 9:19 AM, boltar@caprica.universe wrote: >>> I'd be interested how you'd implement fork() using that method given you >>> need to copy the state of all file descriptors, heap, stack and >>> global memory, current working directory, enviroment variables and a >>> ton of other >>> things I can't remember without googling. >>> >> >> Why even do that? Sigh. > > Why don't you go and find out and educate yourself. > I know how to use windows, and fork is the last thing on my mind.
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Wed, 28 Oct 2026 21:16
Date: Wed, 28 Oct 2026 21:16
40 lines
4045 bytes
4045 bytes
On 10/27/2026 6:43 PM, Lawrence D’Oliveiro wrote: > On Tue, 27 Oct 2026 21:35:09 -0400, James Kuyper wrote: > >> ... without the context that applies elsewhere, your comment about >> resource allocation comes off as a non-sequitur. > > That’s just an excuse. Other comments of mine, from further back in > this particular line of this thread: > > * “What if you’re building an object that needs to be returned to the > caller?” > * “The principle applies to Fortran as it does to any language where > you have to explicitly manage storage allocations.” > * “If you have to do cleanup at each level before exiting, then it works > perfectly well.” > > Did you notice any of that? > > From elsewhere in the discussion: > > I find the C code I write tends to do a lot of dynamic resource > allocations. These can sometimes fail with errors. So error > recovery will invariably involve cleaning up those parts of the > allocations which already succeeded. Gotos are no good for this; > you need to exit levels of structure nesting one by one, disposing > of allocations as you go. > > I put together an example here > <https://gitlab.com/ldo/a_structured_discipline_of_programming>. > This is an extension module that offers services to Python code, > because that is just about the worst example I could think of, for > those who think gotos can cut it. > > Did you pay attention to any of that? Its actually pretty simple. There are libs out there that allow the caller to create the memory it needs. io_uring is just one of them. DirectX12 is another. The user creates all the memory, aligns it, etc, and can update a single frame with a single memcpy.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Wed, 28 Oct 2026 22:06
Date: Wed, 28 Oct 2026 22:06
47 lines
3219 bytes
3219 bytes
On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) boltar@caprica.universe wrote: > On Mon, 26 Oct 2026 21:45:17 +0200 > Michael S <already5chosen@yahoo.com> gabbled: > >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. > > And unix got pthreads in 1995. Windows a decade late as usual. > That's like if I'd say that Linux is 33 years (and counting) late because it has no QueueUserAPC(). Of course, I am smarter than saying such nonsense. More relevantly, Windows (Win32) has preemptive kernel-scheduled threads + assortment of synchronization primitives since very beginning (1993) - ahead of many Unixen and behind some of them. Certainly ahead of Posix standardisation of threads.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Thu, 29 Oct 2026 16:16
Date: Thu, 29 Oct 2026 16:16
43 lines
3612 bytes
3612 bytes
On Wed, 28 Oct 2026 22:05:58 +0200 Michael S <already5chosen@yahoo.com> gabbled: >On Wed, 28 Oct 2026 09:08:44 -0000 (UTC) >boltar@caprica.universe wrote: > >> On Mon, 26 Oct 2026 22:09:01 +0200 >> Michael S <already5chosen@yahoo.com> gabbled: >> >On Mon, 26 Oct 2026 10:01:55 -0000 (UTC) >> >boltar@caprica.universe wrote: >> >> 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. >> >> OK, whats the windows API call thats the equivalent of fork()? I'm not >> talking about CreateProcessA() which doesn't even come close. >> > >There is no equivalent for fork(). But nearly all things that Posix >devs achieve by fork() followed by one or another magic incantation and >then followed by exec() can be achived on Windows as well, typically by >means of one or another magic flag in parameters of CreateProcess or >of one of it's more complicated cousins (CreateProcessAsUser, >CreateProcessWithLogon, CreateProcessWithToken, may be others). These >things never fascinated me, so I am not an expert. > >Now, there were cases where Unix programmers used fork() without >following it by exec(), but I would think that in the recent 25-30 years >such programming patterns are discouraged in favor of threads. Depends how much resilience you need. If the child process needs the state of the parent but doesn't need to interact with it or any of the other child processes much if at all and you're not creating dozens of them a second then why would you use a thread with all the associated hassle of critical section requirements, deadlocks, potential race conditions and one thread crashing killing the whole application?
Re: Re: “The end of software secrecy is almost upon
Author: boltar
Date: Thu, 29 Oct 2026 16:19
Date: Thu, 29 Oct 2026 16:19
40 lines
3118 bytes
3118 bytes
On Wed, 28 Oct 2026 14:04:02 -0700 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >On 10/28/2026 2:01 AM, boltar@caprica.universe wrote: >> On Mon, 26 Oct 2026 13:03:25 -0700 >> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >>> On 10/26/2026 3:01 AM, boltar@caprica.universe wrote: >>>> 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. >> >> Oh really? So you receive an incoming connection to a socket via an >> accept() >> call. In unix you can fork() at that point so the connecting client has a >> server process all to itself with all the state instantly copied from the >> parent process. HOw do you mimic that in windows? Start the server process >> from scratch and pass it a ton of state via the command line or using some >> roll-your-own shared memory nonsense? Give me a break. I guess in >> windows it >> spawns a thread leading to the issue of a single thread crashing >> bringing down >> the entire application - something multiprocess completely avoids. >> > >On Windows? Get used to > >https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsadup >licatesocketa > >DuplicateHandle Right, lets duplicate everything manually - so much easier than one system call. And thats just file descriptors.
Re: Re: “The end of software secrecy is almost upon
Author: boltar
Date: Thu, 29 Oct 2026 16:20
Date: Thu, 29 Oct 2026 16:20
38 lines
2886 bytes
2886 bytes
On Wed, 28 Oct 2026 14:09:32 -0700 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote: >> On Mon, 26 Oct 2026 22:04:33 +0200 >> Michael S <already5chosen@yahoo.com> gabbled: >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) >>> boltar@caprica.universe wrote: >>>> Go ahead and remain clueless. >>>> >>> >>> >>> system() can do most of the same things as spawn() family. >> >> Rubbish, you clearly didn't bother to spend 2 mins googling. >> >>> 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?" >> >> The problem with system is its fire and forget - all you can do with it is >> collect its exit code when its done. You can't communicate with it via >> pipes, you can't control it via signals (well, not easily), you can't set its > >> process group, tty and on and on. Oh, and it also fires up the default shell >to >> do the actual execution making it hideously inefficient. No serious unix dev >> uses system() unless thay have absolutely no choice or it really is a case of > >> "go run this, I don't care what happens". >> >> > >Right. std::system, at least when I use it, makes the caller block until >the process is done. Thats true. Its been so long since I used it I'd forgotten about that. Makes it even less useful.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Thu, 29 Oct 2026 16:22
Date: Thu, 29 Oct 2026 16:22
18 lines
2277 bytes
2277 bytes
On Thu, 29 Oct 2026 00:06:45 +0200 Michael S <already5chosen@yahoo.com> gabbled: >On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) >boltar@caprica.universe wrote: >> And unix got pthreads in 1995. Windows a decade late as usual. >> > >That's like if I'd say that Linux is 33 years (and counting) late >because it has no QueueUserAPC(). Of course, I am smarter than saying >such nonsense. > >More relevantly, Windows (Win32) has preemptive kernel-scheduled threads >+ assortment of synchronization primitives since very beginning (1993) > - ahead of many Unixen and behind some of them. Certainly ahead of > Posix standardisation of threads. Wow, pre-emptive multitasking in 1993. Incredible technology!
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Thu, 29 Oct 2026 19:49
Date: Thu, 29 Oct 2026 19:49
49 lines
3528 bytes
3528 bytes
On 10/29/2026 9:19 AM, boltar@caprica.universe wrote: > On Wed, 28 Oct 2026 14:04:02 -0700 > "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >> On 10/28/2026 2:01 AM, boltar@caprica.universe wrote: >>> On Mon, 26 Oct 2026 13:03:25 -0700 >>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >>>> On 10/26/2026 3:01 AM, boltar@caprica.universe wrote: >>>>> 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. >>> >>> Oh really? So you receive an incoming connection to a socket via an >>> accept() >>> call. In unix you can fork() at that point so the connecting client >>> has a >>> server process all to itself with all the state instantly copied from >>> the >>> parent process. HOw do you mimic that in windows? Start the server >>> process >>> from scratch and pass it a ton of state via the command line or using >>> some >>> roll-your-own shared memory nonsense? Give me a break. I guess in >>> windows it >>> spawns a thread leading to the issue of a single thread crashing >>> bringing down >>> the entire application - something multiprocess completely avoids. >>> >> >> On Windows? Get used to >> >> https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf- >> winsock2-wsadup >> licatesocketa >> >> DuplicateHandle > > Right, lets duplicate everything manually - so much easier than one > system call. > And thats just file descriptors. > Do we actually need everything, or just a subset?
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Thu, 29 Oct 2026 20:39
Date: Thu, 29 Oct 2026 20:39
30 lines
2885 bytes
2885 bytes
On Thu, 29 Oct 2026 16:22:29 -0000 (UTC) boltar@caprica.universe wrote: > On Thu, 29 Oct 2026 00:06:45 +0200 > Michael S <already5chosen@yahoo.com> gabbled: > >On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) > >boltar@caprica.universe wrote: > >> And unix got pthreads in 1995. Windows a decade late as usual. > >> > > > >That's like if I'd say that Linux is 33 years (and counting) late > >because it has no QueueUserAPC(). Of course, I am smarter than saying > >such nonsense. > > > >More relevantly, Windows (Win32) has preemptive kernel-scheduled > >threads > >+ assortment of synchronization primitives since very beginning > >(1993) > > - ahead of many Unixen and behind some of them. Certainly ahead of > > Posix standardisation of threads. > > Wow, pre-emptive multitasking in 1993. Incredible technology! > Not just preemptive multitasking between processes, but kernel-scheduled threads within each process as well. Not a novel idea, but the one that eventually won over all others. In 1993 it was already obvious that it is going to win, but in 1988-1989, when development started, it was less trivial.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Thu, 29 Oct 2026 21:07
Date: Thu, 29 Oct 2026 21:07
59 lines
3704 bytes
3704 bytes
On Thu, 29 Oct 2026 16:20:39 -0000 (UTC) boltar@caprica.universe wrote: > On Wed, 28 Oct 2026 14:09:32 -0700 > "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: > >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote: > >> On Mon, 26 Oct 2026 22:04:33 +0200 > >> Michael S <already5chosen@yahoo.com> gabbled: > >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) > >>> boltar@caprica.universe wrote: > >>>> Go ahead and remain clueless. > >>>> > >>> > >>> > >>> system() can do most of the same things as spawn() family. > >> > >> Rubbish, you clearly didn't bother to spend 2 mins googling. > >> > >>> 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?" > >> > >> The problem with system is its fire and forget - all you can do > >> with it is collect its exit code when its done. You can't > >> communicate with it via pipes, you can't control it via signals > >> (well, not easily), you can't set its > > > >> process group, tty and on and on. Oh, and it also fires up the > >> default shell > >to > >> do the actual execution making it hideously inefficient. No > >> serious unix dev uses system() unless thay have absolutely no > >> choice or it really is a case of > > > >> "go run this, I don't care what happens". > >> > >> > > > >Right. std::system, at least when I use it, makes the caller block > >until the process is done. > > Thats true. Its been so long since I used it I'd forgotten about > that. Makes it even less useful. > Does it block when your command processor is bash and your command string is "my_subprocess &"? Does it block when your command processor is cmd.exe and your command string "start my_subprocess" or "start /b my_subprocess"? I almost certainly tried both in the past, but don't remember what happens in each case. My expectations are that in both cases caller blocked only briefly. It is not blocked until the finish my_subprocess.
Re: “The end of software secrecy is almost upon
Author: Peter Flass
Date: Thu, 29 Oct 2026 22:13
Date: Thu, 29 Oct 2026 22:13
32 lines
3084 bytes
3084 bytes
On 10/29/26 13:39, Michael S wrote: > On Thu, 29 Oct 2026 16:22:29 -0000 (UTC) > boltar@caprica.universe wrote: > >> On Thu, 29 Oct 2026 00:06:45 +0200 >> Michael S <already5chosen@yahoo.com> gabbled: >>> On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) >>> boltar@caprica.universe wrote: >>>> And unix got pthreads in 1995. Windows a decade late as usual. >>>> >>> >>> That's like if I'd say that Linux is 33 years (and counting) late >>> because it has no QueueUserAPC(). Of course, I am smarter than saying >>> such nonsense. >>> >>> More relevantly, Windows (Win32) has preemptive kernel-scheduled >>> threads >>> + assortment of synchronization primitives since very beginning >>> (1993) >>> - ahead of many Unixen and behind some of them. Certainly ahead of >>> Posix standardisation of threads. >> >> Wow, pre-emptive multitasking in 1993. Incredible technology! >> > > Not just preemptive multitasking between processes, but > kernel-scheduled threads within each process as well. > Not a novel idea, but the one that eventually won over all others. > In 1993 it was already obvious that it is going to win, but in > 1988-1989, when development started, it was less trivial. Just an old idea from OS/360 MVT circa 1965-66. OS calls them tasks.
Re: “The end of software secrecy is almost upon
Author: Scott Lurndal
Date: Thu, 29 Oct 2026 22:25
Date: Thu, 29 Oct 2026 22:25
51 lines
3317 bytes
3317 bytes
Michael S <already5chosen@yahoo.com> writes: >On Thu, 29 Oct 2026 16:22:29 -0000 (UTC) >boltar@caprica.universe wrote: > >> On Thu, 29 Oct 2026 00:06:45 +0200 >> Michael S <already5chosen@yahoo.com> gabbled: >> >On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) >> >boltar@caprica.universe wrote: >> >> And unix got pthreads in 1995. Windows a decade late as usual. >> >> >> > >> >That's like if I'd say that Linux is 33 years (and counting) late >> >because it has no QueueUserAPC(). Of course, I am smarter than saying >> >such nonsense. >> > >> >More relevantly, Windows (Win32) has preemptive kernel-scheduled >> >threads >> >+ assortment of synchronization primitives since very beginning >> >(1993) >> > - ahead of many Unixen and behind some of them. Certainly ahead of >> > Posix standardisation of threads. >> >> Wow, pre-emptive multitasking in 1993. Incredible technology! >> > >Not just preemptive multitasking between processes, but >kernel-scheduled threads within each process as well. >Not a novel idea, but the one that eventually won over all others. >In 1993 it was already obvious that it is going to win, but in >1988-1989, when development started, it was less trivial. > The thread design for SVR4 Unix started in the late 80s and released in 1993. Digital published "Evolving the UNIX System Interface to Support Multithreaded Programs" September 28, 1987. (Paul R. McJones and Garret F. Swart). The "The Topaz Operating System User's Guide" in that document describes the thread interface. (DIGITAL Systems Research Center operating system) for both VAX/Ultrix and the Firefly/Taos implementation. Here's a link to the paper published a couple years later: https://softwarepreservation.computerhistory.org/modula2+/doc/McJones_Swart-Evolving-1989.pdf And here's a link to the full technical report #21 (including the manual) https://ftp.zx.net.nz/pub/archive/gatekeeper.dec.com/pub/DEC/SRC/research-reports/SRC-021.pdf
Re: “The end of software secrecy is almost upon
Author: Scott Lurndal
Date: Thu, 29 Oct 2026 22:26
Date: Thu, 29 Oct 2026 22:26
51 lines
3154 bytes
3154 bytes
Michael S <already5chosen@yahoo.com> writes: >On Thu, 29 Oct 2026 16:20:39 -0000 (UTC) >boltar@caprica.universe wrote: > >> On Wed, 28 Oct 2026 14:09:32 -0700 >> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >> >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote: >> >> On Mon, 26 Oct 2026 22:04:33 +0200 >> >> Michael S <already5chosen@yahoo.com> gabbled: >> >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) >> >>> boltar@caprica.universe wrote: >> >>>> Go ahead and remain clueless. >> >>>> >> >>> >> >>> >> >>> system() can do most of the same things as spawn() family. >> >> >> >> Rubbish, you clearly didn't bother to spend 2 mins googling. >> >> >> >>> 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?" >> >> >> >> The problem with system is its fire and forget - all you can do >> >> with it is collect its exit code when its done. You can't >> >> communicate with it via pipes, you can't control it via signals >> >> (well, not easily), you can't set its >> > >> >> process group, tty and on and on. Oh, and it also fires up the >> >> default shell >> >to >> >> do the actual execution making it hideously inefficient. No >> >> serious unix dev uses system() unless thay have absolutely no >> >> choice or it really is a case of >> > >> >> "go run this, I don't care what happens". >> >> >> >> >> > >> >Right. std::system, at least when I use it, makes the caller block >> >until the process is done. >> >> Thats true. Its been so long since I used it I'd forgotten about >> that. Makes it even less useful. >> > >Does it block when your command processor is bash and your command >string is "my_subprocess &"? You might need to do 'nohup my_subprocess &' if my_subprocess doesn't intercept SIGHUP.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Thu, 29 Oct 2026 22:54
Date: Thu, 29 Oct 2026 22:54
62 lines
4000 bytes
4000 bytes
On Thu, 29 Oct 2026 22:26:40 GMT scott@slp53.sl.home (Scott Lurndal) wrote: > Michael S <already5chosen@yahoo.com> writes: > >On Thu, 29 Oct 2026 16:20:39 -0000 (UTC) > >boltar@caprica.universe wrote: > > > >> On Wed, 28 Oct 2026 14:09:32 -0700 > >> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: > >> >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote: > >> >> On Mon, 26 Oct 2026 22:04:33 +0200 > >> >> Michael S <already5chosen@yahoo.com> gabbled: > >> >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC) > >> >>> boltar@caprica.universe wrote: > >> >>>> Go ahead and remain clueless. > >> >>>> > >> >>> > >> >>> > >> >>> system() can do most of the same things as spawn() family. > >> >> > >> >> Rubbish, you clearly didn't bother to spend 2 mins googling. > >> >> > >> >>> 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?" > >> >> > >> >> The problem with system is its fire and forget - all you can do > >> >> with it is collect its exit code when its done. You can't > >> >> communicate with it via pipes, you can't control it via signals > >> >> (well, not easily), you can't set its > >> > > >> >> process group, tty and on and on. Oh, and it also fires up the > >> >> default shell > >> >to > >> >> do the actual execution making it hideously inefficient. No > >> >> serious unix dev uses system() unless thay have absolutely no > >> >> choice or it really is a case of > >> > > >> >> "go run this, I don't care what happens". > >> >> > >> >> > >> > > >> >Right. std::system, at least when I use it, makes the caller block > >> >until the process is done. > >> > >> Thats true. Its been so long since I used it I'd forgotten about > >> that. Makes it even less useful. > >> > > > >Does it block when your command processor is bash and your command > >string is "my_subprocess &"? > > You might need to do 'nohup my_subprocess &' if my_subprocess > doesn't intercept SIGHUP. You are likely right. Otherwise OS will kill my_subprocess at about the same time the caller of system() gets control back. I would not figure it out myself.
Re: “The end of software secrecy is almost upon
Author: Dan Cross
Date: Fri, 30 Oct 2026 02:10
Date: Fri, 30 Oct 2026 02:10
63 lines
3553 bytes
3553 bytes
In article <EJPES.62185$BaS5.30884@fx35.iad>, Scott Lurndal <slp53@pacbell.net> wrote: >Michael S <already5chosen@yahoo.com> writes: >>On Thu, 29 Oct 2026 16:22:29 -0000 (UTC) >>boltar@caprica.universe wrote: >> >>> On Thu, 29 Oct 2026 00:06:45 +0200 >>> Michael S <already5chosen@yahoo.com> gabbled: >>> >On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) >>> >boltar@caprica.universe wrote: >>> >> And unix got pthreads in 1995. Windows a decade late as usual. >>> >> >>> > >>> >That's like if I'd say that Linux is 33 years (and counting) late >>> >because it has no QueueUserAPC(). Of course, I am smarter than saying >>> >such nonsense. >>> > >>> >More relevantly, Windows (Win32) has preemptive kernel-scheduled >>> >threads >>> >+ assortment of synchronization primitives since very beginning >>> >(1993) >>> > - ahead of many Unixen and behind some of them. Certainly ahead of >>> > Posix standardisation of threads. >>> >>> Wow, pre-emptive multitasking in 1993. Incredible technology! >>> >> >>Not just preemptive multitasking between processes, but >>kernel-scheduled threads within each process as well. >>Not a novel idea, but the one that eventually won over all others. >>In 1993 it was already obvious that it is going to win, but in >>1988-1989, when development started, it was less trivial. > >The thread design for SVR4 Unix started in the late 80s and >released in 1993. > >Digital published "Evolving the UNIX System Interface to >Support Multithreaded Programs" September 28, 1987. >(Paul R. McJones and Garret F. Swart). > >The "The Topaz Operating System User's Guide" in that document >describes the thread interface. (DIGITAL Systems Research >Center operating system) for both VAX/Ultrix and the Firefly/Taos >implementation. > >Here's a link to the paper published a couple years later: > >https://softwarepreservation.computerhistory.org/modula2+/doc/McJones_Swart-Evolving-1989.pdf > >And here's a link to the full technical report #21 (including the manual) > >https://ftp.zx.net.nz/pub/archive/gatekeeper.dec.com/pub/DEC/SRC/research-reports/SRC-021.pdf Speaking of.... I have a distinct memory of reading a paper called something like, "fork mixed with threads considered harmful"; I could have sworn it was by Luca Cardelli, but I do not think that is correct, nor can I find it.... At least the Gatekeeper archive of SRC reports was mirrored. Maybe it's in there (it's not the evolving paper, though that touches on the issues). - Dan C.
Re: “The end of software secrecy is almost upon
Author: Dan Cross
Date: Fri, 30 Oct 2026 02:22
Date: Fri, 30 Oct 2026 02:22
114 lines
4677 bytes
4677 bytes
In article <20261030005434.00005458@yahoo.com>,
Michael S <already5chosen@yahoo.com> wrote:
>On Thu, 29 Oct 2026 22:26:40 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>
>> Michael S <already5chosen@yahoo.com> writes:
>> >On Thu, 29 Oct 2026 16:20:39 -0000 (UTC)
>> >boltar@caprica.universe wrote:
>> >
>> >> On Wed, 28 Oct 2026 14:09:32 -0700
>> >> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
>> >> >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote:
>> >> >> On Mon, 26 Oct 2026 22:04:33 +0200
>> >> >> Michael S <already5chosen@yahoo.com> gabbled:
>> >> >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC)
>> >> >>> boltar@caprica.universe wrote:
>> >> >>>> Go ahead and remain clueless.
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>> system() can do most of the same things as spawn() family.
>> >> >>
>> >> >> Rubbish, you clearly didn't bother to spend 2 mins googling.
>> >> >>
>> >> >>> 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?"
>> >> >>
>> >> >> The problem with system is its fire and forget - all you can do
>> >> >> with it is collect its exit code when its done. You can't
>> >> >> communicate with it via pipes, you can't control it via signals
>> >> >> (well, not easily), you can't set its
>> >> >
>> >> >> process group, tty and on and on. Oh, and it also fires up the
>> >> >> default shell
>> >> >to
>> >> >> do the actual execution making it hideously inefficient. No
>> >> >> serious unix dev uses system() unless thay have absolutely no
>> >> >> choice or it really is a case of
>> >> >
>> >> >> "go run this, I don't care what happens".
>> >> >>
>> >> >>
>> >> >
>> >> >Right. std::system, at least when I use it, makes the caller block
>> >> >until the process is done.
>> >>
>> >> Thats true. Its been so long since I used it I'd forgotten about
>> >> that. Makes it even less useful.
>> >>
>> >
>> >Does it block when your command processor is bash and your command
>> >string is "my_subprocess &"?
>>
>> You might need to do 'nohup my_subprocess &' if my_subprocess
>> doesn't intercept SIGHUP.
>
>
>You are likely right. Otherwise OS will kill my_subprocess at about the
>same time the caller of system() gets control back.
>I would not figure it out myself.
Only if you intended to close the TTY the programs were started
on. Otherwise, I don't see why it would be necessary:
```
term% cat a.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int
main(void)
{
struct tm *t;
time_t now = time(NULL);
printf("Starting child, time is %s", asctime(gmtime(&now)));
sleep(5);
now = time(NULL);
printf("Bye bye, now is %s", asctime(gmtime(&now)));
}
term% cat b.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int
main(void)
{
time_t now = time(NULL);
printf("Parent starting, time is %s", asctime(gmtime(&now)));
system("./a &");
printf("./a started in background\n");
sleep(2);
now = time(NULL);
printf("Ahhh!!! time is %s", asctime(gmtime(&now)));
return 0;
}
term% make a
cc -O2 -pipe -o a a.c
term% make b
cc -O2 -pipe -o b b.c
term% ./b
Parent starting, time is Fri Oct 30 02:21:06 2026
./a started in background
Starting child, time is Fri Oct 30 02:21:06 2026
Ahhh!!! time is Fri Oct 30 02:21:08 2026
term% Bye bye, now is Fri Oct 30 02:21:11 2026
```
- Dan C.
Re: “The end of software secrecy is almost upon us"
Author: John Smith
Date: Fri, 30 Oct 2026 05:04
Date: Fri, 30 Oct 2026 05:04
14 lines
1263 bytes
1263 bytes
On 14/10/2026 05:18, Lynn McGuire wrote: > “The end of software secrecy is almost upon us. The death of closed > source, and the final triumph of open source. ” -Eric S. Raymond. What's the situation re C++ 26? <https://elsolitario.org/en/2026/10/26/according-to-seacord-cpp26-fails-dis-ballot-12-of-20/> Any progress?
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Fri, 30 Oct 2026 08:59
Date: Fri, 30 Oct 2026 08:59
123 lines
5514 bytes
5514 bytes
On Fri, 30 Oct 2026 02:22:43 -0000 (UTC)
cross@spitfire.i.gajendra.net (Dan Cross) wrote:
> In article <20261030005434.00005458@yahoo.com>,
> Michael S <already5chosen@yahoo.com> wrote:
> >On Thu, 29 Oct 2026 22:26:40 GMT
> >scott@slp53.sl.home (Scott Lurndal) wrote:
> >
> >> Michael S <already5chosen@yahoo.com> writes:
> >> >On Thu, 29 Oct 2026 16:20:39 -0000 (UTC)
> >> >boltar@caprica.universe wrote:
> >> >
> >> >> On Wed, 28 Oct 2026 14:09:32 -0700
> >> >> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled:
> >> >> >On 10/28/2026 2:06 AM, boltar@caprica.universe wrote:
> >> >> >> On Mon, 26 Oct 2026 22:04:33 +0200
> >> >> >> Michael S <already5chosen@yahoo.com> gabbled:
> >> >> >>> On Mon, 26 Oct 2026 09:51:51 -0000 (UTC)
> >> >> >>> boltar@caprica.universe wrote:
> >> >> >>>> Go ahead and remain clueless.
> >> >> >>>>
> >> >> >>>
> >> >> >>>
> >> >> >>> system() can do most of the same things as spawn() family.
> >> >> >>
> >> >> >> Rubbish, you clearly didn't bother to spend 2 mins googling.
> >> >> >>
> >> >> >>> 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?"
> >> >> >>
> >> >> >> The problem with system is its fire and forget - all you can
> >> >> >> do with it is collect its exit code when its done. You can't
> >> >> >> communicate with it via pipes, you can't control it via
> >> >> >> signals (well, not easily), you can't set its
> >> >> >
> >> >> >> process group, tty and on and on. Oh, and it also fires up
> >> >> >> the default shell
> >> >> >to
> >> >> >> do the actual execution making it hideously inefficient. No
> >> >> >> serious unix dev uses system() unless thay have absolutely no
> >> >> >> choice or it really is a case of
> >> >> >
> >> >> >> "go run this, I don't care what happens".
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >Right. std::system, at least when I use it, makes the caller
> >> >> >block until the process is done.
> >> >>
> >> >> Thats true. Its been so long since I used it I'd forgotten about
> >> >> that. Makes it even less useful.
> >> >>
> >> >
> >> >Does it block when your command processor is bash and your command
> >> >string is "my_subprocess &"?
> >>
> >> You might need to do 'nohup my_subprocess &' if my_subprocess
> >> doesn't intercept SIGHUP.
> >
> >
> >You are likely right. Otherwise OS will kill my_subprocess at about
> >the same time the caller of system() gets control back.
> >I would not figure it out myself.
>
> Only if you intended to close the TTY the programs were started
> on. Otherwise, I don't see why it would be necessary:
What happens when caller is GUI-style application?
>
> ```
> term% cat a.c
> #include <stdio.h>
> #include <stdlib.h>
> #include <time.h>
> #include <unistd.h>
>
> int
> main(void)
> {
> struct tm *t;
> time_t now = time(NULL);
> printf("Starting child, time is %s", asctime(gmtime(&now)));
> sleep(5);
> now = time(NULL);
> printf("Bye bye, now is %s", asctime(gmtime(&now)));
> }
> term% cat b.c
> #include <stdio.h>
> #include <stdlib.h>
> #include <time.h>
> #include <unistd.h>
>
> int
> main(void)
> {
> time_t now = time(NULL);
> printf("Parent starting, time is %s", asctime(gmtime(&now)));
> system("./a &");
> printf("./a started in background\n");
> sleep(2);
> now = time(NULL);
> printf("Ahhh!!! time is %s", asctime(gmtime(&now)));
> return 0;
> }
> term% make a
> cc -O2 -pipe -o a a.c
> term% make b
> cc -O2 -pipe -o b b.c
> term% ./b
> Parent starting, time is Fri Oct 30 02:21:06 2026
> ./a started in background
> Starting child, time is Fri Oct 30 02:21:06 2026
> Ahhh!!! time is Fri Oct 30 02:21:08 2026
> term% Bye bye, now is Fri Oct 30 02:21:11 2026
> ```
>
> - Dan C.
>
Re: Re: “The end of software secrecy is almost upon
Author: boltar
Date: Fri, 30 Oct 2026 11:21
Date: Fri, 30 Oct 2026 11:21
13 lines
2025 bytes
2025 bytes
On Thu, 29 Oct 2026 12:49:55 -0700 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> gabbled: >On 10/29/2026 9:19 AM, boltar@caprica.universe wrote: >> Right, lets duplicate everything manually - so much easier than one >> system call. >> And thats just file descriptors. >> > >Do we actually need everything, or just a subset? That will depend entirely on the application. There could be a boatload of startup config in memory plus all the enviroment variables.
Re: “The end of software secrecy is almost upon
Author: Dan Cross
Date: Fri, 30 Oct 2026 11:25
Date: Fri, 30 Oct 2026 11:25
124 lines
5773 bytes
5773 bytes
In article <20261030105900.000020ce@yahoo.com>,
Michael S <already5chosen@yahoo.com> wrote:
>On Fri, 30 Oct 2026 02:22:43 -0000 (UTC)
>cross@spitfire.i.gajendra.net (Dan Cross) wrote:
>
>> In article <20261030005434.00005458@yahoo.com>,
>> Michael S <already5chosen@yahoo.com> wrote:
>> >On Thu, 29 Oct 2026 22:26:40 GMT
>> >scott@slp53.sl.home (Scott Lurndal) wrote:
>> >
>> >> Michael S <already5chosen@yahoo.com> writes:
>> >> >On Thu, 29 Oct 2026 16:20:39 -0000 (UTC)
>> >> >[snip]
>> >> >Does it block when your command processor is bash and your command
>> >> >string is "my_subprocess &"?
>> >>
>> >> You might need to do 'nohup my_subprocess &' if my_subprocess
>> >> doesn't intercept SIGHUP.
>> >
>> >
>> >You are likely right. Otherwise OS will kill my_subprocess at about
>> >the same time the caller of system() gets control back.
>> >I would not figure it out myself.
>>
>> Only if you intended to close the TTY the programs were started
>> on. Otherwise, I don't see why it would be necessary:
>
>What happens when caller is GUI-style application?
That depends on a number of factors, but basically, "it does the
same thing". Why would it be any different?
SIGHUP is the "hangup" signal, and _usually_ generated by the
kernel when a process loses its controlling terminal, though it
_can_ be sent from the command line (or a program) using the
`kill` command or one of its many imitators (basically, anything
that invokes `raise()` or the `kill()` system call).
The classic example of its use was a dial-in terminal line that
recognized modem status and reacted to a "carrier detect" signal
dropping; the kernel would clean up by SIGHUP'ing the process
group of anything associated with that terminal; one can see
this readily in early Unix kernel sources. This is a reason why
SIGHUP is one of the few signals a shell will actually honor.
Nowadays, this most often happens when an interactive session
associated with a pseudoterminal is closed; this could be window
in a terminal emulator program, or it could be a network login
via e.g. `ssh` that closes.
For programs that are not associated with a TTY at all, this
won't happen; this is why traditionally Unix daemons often
overloaded SIGHUP to force reloading a config file or similar:
since daemons are not generally associated with user ttys (or
often any TTY at all, including the console), the kernel will
never automatically send them a SIGHUP to terminate, so it's a
"safe" signal to pick for administrative control.
Crucially, using `system()` to invoke a program, even one that
is backgrounded, does not usually allocate a new terminal, nor
does it necessarily close one (though I suppose one could use it
to invoke something like, `kill -9 -1` to zap all of one's
processes; you could even background that if you wanted, but
that seems silly).
GUI programs are no different in this regard. Many of them may
not even be associated with a tty device at all, and may receive
their "session has ended" notification some other way.
So I go back to my original statement, "only if you intended to
close the TTY the programs were started on." IF you intend to
start some long-running program in the background and you won't
stay logged in after doing that, then sure, use `nohup`. But
if you don't care about that, then you don't need to bother.
The OS will not kill your program when the shell started by
`system` exits or anything; nor will the shell itself.
- Dan C.
>> ```
>> term% cat a.c
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <time.h>
>> #include <unistd.h>
>>
>> int
>> main(void)
>> {
>> time_t now = time(NULL);
>> printf("Starting child, time is %s", asctime(gmtime(&now)));
>> sleep(5);
>> now = time(NULL);
>> printf("Bye bye, now is %s", asctime(gmtime(&now)));
>> }
>> term% cat b.c
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <time.h>
>> #include <unistd.h>
>>
>> int
>> main(void)
>> {
>> time_t now = time(NULL);
>> printf("Parent starting, time is %s", asctime(gmtime(&now)));
>> system("./a &");
>> printf("./a started in background\n");
>> sleep(2);
>> now = time(NULL);
>> printf("Ahhh!!! time is %s", asctime(gmtime(&now)));
>> return 0;
>> }
>> term% make a
>> cc -O2 -pipe -o a a.c
>> term% make b
>> cc -O2 -pipe -o b b.c
>> term% ./b
>> Parent starting, time is Fri Oct 30 02:21:06 2026
>> ./a started in background
>> Starting child, time is Fri Oct 30 02:21:06 2026
>> Ahhh!!! time is Fri Oct 30 02:21:08 2026
>> term% Bye bye, now is Fri Oct 30 02:21:11 2026
>> ```
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Fri, 30 Oct 2026 11:25
Date: Fri, 30 Oct 2026 11:25
36 lines
3126 bytes
3126 bytes
On Thu, 29 Oct 2026 22:39:22 +0200 Michael S <already5chosen@yahoo.com> gabbled: >On Thu, 29 Oct 2026 16:22:29 -0000 (UTC) >boltar@caprica.universe wrote: > >> On Thu, 29 Oct 2026 00:06:45 +0200 >> Michael S <already5chosen@yahoo.com> gabbled: >> >On Wed, 28 Oct 2026 08:58:55 -0000 (UTC) >> >boltar@caprica.universe wrote: >> >> And unix got pthreads in 1995. Windows a decade late as usual. >> >> >> > >> >That's like if I'd say that Linux is 33 years (and counting) late >> >because it has no QueueUserAPC(). Of course, I am smarter than saying >> >such nonsense. >> > >> >More relevantly, Windows (Win32) has preemptive kernel-scheduled >> >threads >> >+ assortment of synchronization primitives since very beginning >> >(1993) >> > - ahead of many Unixen and behind some of them. Certainly ahead of >> > Posix standardisation of threads. >> >> Wow, pre-emptive multitasking in 1993. Incredible technology! >> > >Not just preemptive multitasking between processes, but >kernel-scheduled threads within each process as well. >Not a novel idea, but the one that eventually won over all others. >In 1993 it was already obvious that it is going to win, but in >1988-1989, when development started, it was less trivial. Implementing threads is trivial compared to implementing multi processes with shared memory. Adding them to a pre-existing kernel might be tricky but when you're building one from scratch as per NT then its hardly a big deal.
Page 9 of 11 • 529 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