๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.arts.sf.written
Article #601

Re: โ€œThe end of software secrecy is almost upon

#601
From: Michael S
Date: Sun, 25 Oct 2026 06:42
158 lines
8273 bytes
On Sun, 25 Oct 2026 00:28:19 -0000 (UTC)
cross@spitfire.i.gajendra.net (Dan Cross) wrote:

> In article <20261025011151.000038ef@yahoo.com>,
> Michael S  <already5chosen@yahoo.com> 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.  
> 
> First, he's a big boy, and I'm sure he can answer for himself.
> But ok then, C++, not C.  The questions still stand.
> 
> >Second, while in theory threads can be implemented by C++
> >compilers+language  support library, in practice I had never seen it
> >done.  
> 
> This is not saying much about anything aside from the countours
> of your own experience, I'm afraid.
> 
> >All I had seen is C++ threads implemented in library as thin
> >wrapper atop of the OS (or RT executive) implementation.  
> 
> In the late 1990s, into the early 2000s, most "threads" on
> Unix-style systems were implemented in userspace, in the C
> library, often by exposing the "normal" system call endpoints
> in the library, but making them thin wrappers around equivalent
> asynchronous system calls.
> 
> There was even a paper about using the Xinu pedagogical system
> from Doug Comer to implement something very close to threads on
> 4.2BSD, with signals and a context saving/restoration primitive
> to approximate a timer interrupt.
> 
> For a more recent historical example the FreeBSD MP library was
> initially implemented this way, as were pre-LinuxThreasd threads
> on Linux; Solaris threads up until Solaris 2.6 or so similarly.
> 
> Of course, it wasn't a great way to do things because if
> something _did_ block...well, there went your concurrency.
> 
> Making Unix systems multithreaded was challenging because of
> decades of software that was written assuming a single-threaded
> userspace environment (the kernel had been "multithreaded" since
> very near the start, even if much of the system was written
> assuming a single processor; but parallelism is not the same
> thing as concurrency), and this was compounded because people
> were trying to implement complex M:N threading models; Sun did
> this, and FreeBSD tried with their KSEs; the Linux people did
> not.  While cool in theory, M:N threading relied on very
> specific usage patterns to work well in practice, and almost no
> one actually wrote software that way, so you ended up with
> userspace threads fighting the kernel scheeduler, and vice
> versa.
> 
> More recently, the Akaros research system introduced the notion
> of a "many-core process" and pushed fine-grained "thread"
> scheduling entirely to userspace; the kernel is totally unaware
> of how userspace schedules anything.  That system uses an N:C
> model, where $C$ is the number of *cores* assigned to a process
> (all system calls in Akaros are asychronous by design, to avoid
> the pitfalls of user-threads blocking on synchronous kernel
> services that beset Unix).
> 

How any of this trivia has anything to do with real-world
implementations of C++11 threads?

> >I can not see while the same can't be done for processes, with
> >API modeled on posix_spawn() or Windows CreateProcess().  
> 
> C, and C++, have had `system()` for as long as I can remember,
> if you just want to run a program (note that both `posix_spawn`
> and `CreateProcess` take the names of programs to run in that
> new process).
>

I mentioned that in one of my earlier responses to boltar.
However there exist situation in which system() is not a satisfactory
replacement for spawn(), most often because overhead of launching shell
sometimes matters.

> >It does not look like variety in this field is bigger than in case of
> >threads. More like it is smaller.  
> 
> Nope.  But if you think differently, see the questions above.
> 
> >Now, would it be the first thing I would want like addition to C++
> >standard library? No it would not be.
> >The first thing would be IPv4 communication, sockets, poll etc...  
> 
> POSIX has all of that.  POSIX also has a process model.  Why not
> just make POSIX a part of the language, then?  (Answer that and
> you may start to understand why this is harder than it looks
> for C++ [and C].)
> 
> 	- Dan C.
> 

It (both spawn and IPv4) is not harder (and not easier) than
fopen/fread/fwrite or than time-related functions.




Technical Details
Message-ID: <20261025084234.0000449c@yahoo.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11amvre$15far$1@dont-email.me> <11bj08r$309uk$1@dont-email.me> <11bj7na$5bt$1@reader2.panix.com> <20261025011151.000038ef@yahoo.com> <11bjif3$7p0$1@reader2.panix.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: rec.arts.sf.written,comp.lang.fortran,comp.lang.c++,alt.comp.lang.rust,alt.folklore.computers
Subject: Re: โ€œThe end of software secrecy is almost upon
Date: Sun, 25 Oct 2026 08:42:34 +0200
Organization: A noiseless patient Spider
Lines: 158
Message-ID: <20261025084234.0000449c@yahoo.com>
References: <11amvre$15far$1@dont-email.me>
	<11bj08r$309uk$1@dont-email.me>
	<11bj7na$5bt$1@reader2.panix.com>
	<20261025011151.000038ef@yahoo.com>
	<11bjif3$7p0$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 25 Oct 2026 06:42:42 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3304854"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+3z9fsfqC/8qetjDhUYyCylNWBNcqVNLY="; posting-host="752fd8fa3081ef4da652eaf9d9a16c84"
Cancel-Lock: sha1:h8xUM6GfZd9hHkaBYBLcBwb0/0A= sha256:GmbMSIltj54HcdBS8DFh3r8Po545texUCjKwYEX2pHw=
	sha1:/a35bL3kynAraS1pSnDjbPwcLR4= sha256:68AUQM+L79sI1yZQWWyHXeDLVlkcPUqPqLJcWDfqK3g=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)