Sujet : Re: xxd -i vs DIY Was: C23 thoughts and opinions
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 03. Jun 2024, 07:57:16
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3jpgc$3pmi3$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 03/06/2024 05:15, Lawrence D'Oliveiro wrote:
On Thu, 30 May 2024 00:40:07 -0400, Paul wrote:
WSL uses containers, so of course it is slow.
WSL1 had a Linux “personality” on top of the NT kernel. So this was
emulation, not containers.
WSL2 uses Hyper-V to run Linux inside a VM. Again, not containers.
Linux has containers, which are based entirely on namespace isolation (and
cgroups for process management). These are all standard kernel mechanisms,
so there should be very little overhead in using them.
I can't answer for WSL, having not used it myself. But I have used Linux containers of various sorts since OpenVZ (and even chroot jails before that), and there's no doubt that the overhead is usually negligible.
The whole deal with containers is that everything runs on the same kernel, but with different namespaces and file system root. If WSL were to work by containers, it would need to run the Linux processes as processes under the NT kernel. I suppose that might be possible, with a translation layer for all system API calls. After all, you can run Windows processes on Linux with Wine - perhaps a similar principle can work for Windows?