[TUHS] non-blocking IO - threads

Larry McVoy lm at mcvoy.com
Wed Jun 3 09:21:14 AEST 2020


On Wed, Jun 03, 2020 at 09:09:08AM +1000, Rob Pike wrote:
> The first mistake people made was to split "thread" from "process". What
> those words mean today is not what they meant a generation ago.

So I'm a fan of your quote, Rob, "If you think you need threads, your
processes are too fat".

Years ago, I asked Linus if he could fix the one flaw with that point
of view.  Which is, processes can't share page tables.  So N processes
will have N page tables, need an N way bigger TBL, to get the same
performance.

What I asked Linus to try and do is allow a process to share all or
part of its page table with another process.  If that could be done,
we could pretty do what you said, just use processes and if they want
to act like threads, just share the page table.

And I just looked, he seems to have done it.  man 2 clone on a
Linux box.  It's the swiss army knife of features, feels messy.

I don't know if CLONE_VM will share the page tables, I'll ask
Linus.

--lm


More information about the TUHS mailing list