Thread View: comp.lang.fortran
508 messages
508 total messages
Page 9 of 11
Started by Lynn McGuire
Wed, 14 Oct 2026 04:18
Page 9 of 11 • 508 total messages
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: “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: “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.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Fri, 30 Oct 2026 13:23
Date: Fri, 30 Oct 2026 13:23
14 lines
1692 bytes
1692 bytes
On Fri, 30 Oct 2026 11:25:01 -0000 (UTC) cross@spitfire.i.gajendra.net (Dan Cross) wrote: > The OS will not kill your program when the shell started by > `system` exits or anything; > Good to know. > nor will the shell itself. That part I guessed myself.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Fri, 30 Oct 2026 16:07
Date: Fri, 30 Oct 2026 16:07
18 lines
2079 bytes
2079 bytes
On Fri, 30 Oct 2026 11:25:01 -0000 (UTC) cross@spitfire.i.gajendra.net (Dan Cross) gabbled: >In article <20261030105900.000020ce@yahoo.com>, >Michael S <already5chosen@yahoo.com> wrote: >>> 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? Windows treats GUI apps entirely differently to console ones so a Windows dev might not appreciate that on unix there is no demarcation - a GUI app simply has a network connection to the X server and it can either sit in an event loop waiting for events - as per a windows main thread - or go do other things and periodically check the X event list.
Re: “The end of software secrecy is almost upon
Author: Chris M. Thomasson
Date: Fri, 30 Oct 2026 18:05
Date: Fri, 30 Oct 2026 18:05
42 lines
3725 bytes
3725 bytes
On 10/30/2026 4:25 AM, boltar@caprica.universe wrote: > 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. > Multi process with shared memory can be tricky indeed. Step one, you need to ponder on making it "robust". Threads do not need to be robust. Well, you should not have a thread up and die anyway. Now, for multi process, that should be handled. There are many different ways.
Re: “The end of software secrecy is almost upon
Author: Jeroen Belleman
Date: Fri, 30 Oct 2026 19:37
Date: Fri, 30 Oct 2026 19:37
26 lines
2751 bytes
2751 bytes
On 10/30/26 17:07, boltar@caprica.universe wrote: > On Fri, 30 Oct 2026 11:25:01 -0000 (UTC) > cross@spitfire.i.gajendra.net (Dan Cross) gabbled: >> In article <20261030105900.000020ce@yahoo.com>, >> Michael S <already5chosen@yahoo.com> wrote: >>>> 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? > > Windows treats GUI apps entirely differently to console ones so a Windows > dev might not appreciate that on unix there is no demarcation - a GUI app > simply has a network connection to the X server and it can either sit in > an event loop waiting for events - as per a windows main thread - or go do > other things and periodically check the X event list. > That's where threads are useful: The GUI is one thread, and the "other things" are in one or more other threads. There are altogether too many programs that hang the GUI while "other things" are going on. That should never happen! Jeroen Belleman
Re: “The end of software secrecy is almost upon us”
Author: Lawrence D’Oliveiro
Date: Fri, 30 Oct 2026 22:35
Date: Fri, 30 Oct 2026 22:35
31 lines
3049 bytes
3049 bytes
On Fri, 30 Oct 2026 20:37:14 +0100, Jeroen Belleman wrote: > That's where threads are useful: The GUI is one thread, and the > "other things" are in one or more other threads. There are > altogether too many programs that hang the GUI while "other things" > are going on. That should never happen! Back in the 1990s, threading was seen as the answer to everything. Some even tried multithreaded GUIs. The trouble with threading is its “default-shared-everything” model, as opposed to separate processes, which are “default-shared-nothing”. It is all too easy to forget to synchronize access to shared objects, lock things properly etc, and end up with hard-to-diagnose bugs that tend to hide themselves when you try to go look for them (see “Heisenbug”). The trend nowadays is to revive the old coroutine concept, in a new guise called “stackless” coroutines. These give you support for async operations, but with transfers of control being made explicit at “await” points, rather than unpredictably as with full preemptive threading. This greatly reduces the opportunity for race conditions. Credit to Microsoft for pioneering this, but nowadays you see the idea popping up in JavaScript and Python and who knows where else. Threading is still definitely useful, mainly for performance, where the bottleneck is in CPU usage. But if a program is spending most of its time waiting for I/O over the network, or for a user to initiate a GUI action, or something external and relatively slow like that, then coroutines keep things simpler.
Re: “The end of software secrecy is almost upon us”
Author: Charlie Gibbs
Date: Sat, 31 Oct 2026 04:14
Date: Sat, 31 Oct 2026 04:14
20 lines
2163 bytes
2163 bytes
On 2026-10-30, Lawrence D’Oliveiro <ldo@nz.invalid> wrote: > Threading is still definitely useful, mainly for performance, where > the bottleneck is in CPU usage. But if a program is spending most of > its time waiting for I/O over the network, or for a user to initiate a > GUI action, or something external and relatively slow like that, then > coroutines keep things simpler. I've always tried to avoid the complexities of threading; in most cases I can get away with round-robin scheduling. But I found that some servers are very slow to respond, and even when trying to do a non-blocking setup of a TCP/IP connection, the connect() API would unavoidably block. I had to spin that part off into its own thread to keep the rest of the program (including other connections) from hanging. -- /~\ Charlie Gibbs | In this world there are \ / <cgibbs@kltpzyxm.invalid> | two kinds of people: X I'm really at ac.dekanfrus | 1. Those who can extrapolate / \ if you read it the right way. | from incomplete data.
Re: “The end of software secrecy is almost upon us”
Author: Lawrence D’Oliveiro
Date: Sat, 31 Oct 2026 05:37
Date: Sat, 31 Oct 2026 05:37
32 lines
3247 bytes
3247 bytes
On Sat, 31 Oct 2026 04:14:05 GMT, Charlie Gibbs wrote:
> I've always tried to avoid the complexities of threading; in most
> cases I can get away with round-robin scheduling. But I found that
> some servers are very slow to respond, and even when trying to do a
> non-blocking setup of a TCP/IP connection, the connect() API would
> unavoidably block. I had to spin that part off into its own thread
> to keep the rest of the program (including other connections) from
> hanging.
Here’s a fun little thing: if you set a socket to nonblocking and then
do the connect(2) call, it will seemingly fail with an EINPROGRESS
error. But in fact, the connection attempt gets initiated, and you can
monitor its subsequent progress from your event loop.
From the ERRORS section of <https://manpages.debian.org/connect(2)>:
EINPROGRESS
The socket is nonblocking and the connection cannot be
completed immediately. (UNIX domain sockets failed with EAGAIN
instead.) It is possible to select(2) or poll(2) for
completion by selecting the socket for writing. After
select(2) indicates writability, use getsockopt(2) to read the
SO_ERROR option at level SOL_SOCKET to determine whether
connect() completed successfully (SO_ERROR is zero) or
unsuccessfully (SO_ERROR is one of the usual error codes
listed here, explaining the reason for the failure).
I’m not sure about doing this sort of thing from other libraries that
wrap socket connections (e.g. SSL/TLS libraries); for these, the usual
fallback is still available, as you say, by turning a blocking call
into a nonblocking one by pushing it off to a separate thread.
Re: Re: “The end of software secrecy is almost upon
Author: boltar
Date: Sat, 31 Oct 2026 09:38
Date: Sat, 31 Oct 2026 09:38
30 lines
2768 bytes
2768 bytes
On Fri, 30 Oct 2026 20:37:14 +0100 Jeroen Belleman <jeroen@nospam.please> gabbled: >On 10/30/26 17:07, boltar@caprica.universe wrote: >> On Fri, 30 Oct 2026 11:25:01 -0000 (UTC) >> cross@spitfire.i.gajendra.net (Dan Cross) gabbled: >>> In article <20261030105900.000020ce@yahoo.com>, >>> Michael S <already5chosen@yahoo.com> wrote: >>>>> 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? >> >> Windows treats GUI apps entirely differently to console ones so a Windows >> dev might not appreciate that on unix there is no demarcation - a GUI app >> simply has a network connection to the X server and it can either sit in >> an event loop waiting for events - as per a windows main thread - or go do >> other things and periodically check the X event list. >> > >That's where threads are useful: The GUI is one thread, and the "other >things" are in one or more other threads. There are altogether too many >programs that hang the GUI while "other things" are going on. That >should never happen! If its multithreaded but that still happens someone probably has created too many critical sections with too many locks.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Sat, 31 Oct 2026 09:45
Date: Sat, 31 Oct 2026 09:45
30 lines
2297 bytes
2297 bytes
On Fri, 30 Oct 2026 22:35:05 -0000 (UTC)
Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled:
>The trend nowadays is to revive the old coroutine concept, in a new
>guise called “stackless” coroutines. These give you support for async
>operations, but with transfers of control being made explicit at
>“await” points, rather than unpredictably as with full preemptive
>threading. This greatly reduces the opportunity for race conditions.
Coroutines are just a complicated way to re-implement a function with a load
of statics.
eg:
void myfunc()
{
static int i = 0;
for(;;++i)
{
[do something based on value of i]
[return when some condition met]
}
}
Also the C++ implementation is so bad its unusable.
>Credit to Microsoft for pioneering this, but nowadays you see the idea
>popping up in JavaScript and Python and who knows where else.
Python nailed it - you just call "yield", job done.
Re: “The end of software secrecy is almost upon
Author: boltar
Date: Sat, 31 Oct 2026 09:47
Date: Sat, 31 Oct 2026 09:47
13 lines
2161 bytes
2161 bytes
On Sat, 31 Oct 2026 05:37:23 -0000 (UTC) Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled: >Here’s a fun little thing: if you set a socket to nonblocking and then >do the connect(2) call, it will seemingly fail with an EINPROGRESS >error. But in fact, the connection attempt gets initiated, and you can >monitor its subsequent progress from your event loop. Far too many devs don't know about or don't understand multiplexing using select() or poll(). Admittedly these are borked on Windows as you can't use sockets with them which is their main raison d'etre, but on unix they're a very powerful tool. For simple servers with a low workload they can allow single threaded development simplifying the code immensely.
Re: “The end of software secrecy is almost upon
Author: Michael S
Date: Sat, 31 Oct 2026 17:56
Date: Sat, 31 Oct 2026 17:56
24 lines
2520 bytes
2520 bytes
On Sat, 31 Oct 2026 09:47:42 -0000 (UTC) boltar@caprica.universe wrote: > On Sat, 31 Oct 2026 05:37:23 -0000 (UTC) > Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled: > >Here’s a fun little thing: if you set a socket to nonblocking and > >then do the connect(2) call, it will seemingly fail with an > >EINPROGRESS error. But in fact, the connection attempt gets > >initiated, and you can monitor its subsequent progress from your > >event loop. > > Far too many devs don't know about or don't understand multiplexing > using select() or poll(). Admittedly these are borked on Windows as > you can't use sockets with them On what planet? > which is their main raison d'etre, > but on unix they're a very powerful tool. For simple servers with a > low workload they can allow single threaded development simplifying > the code immensely. >
Page 9 of 11 • 508 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