Re: Virtual Threads
Niall Ross <[email protected]> Tue, 15 Mar 2022 22:16:04 +0000
| Newsgroups | gmane.comp.lang.smalltalk.vwnc |
|---|---|
| Organization | Cincom |
| Message-ID | <[email protected]> |
Dear Annick, a CST process that runs a block that does as little as possible (so context stacks stay as short as possible) will create 3-4 contexts that can be allocated virtually in the stack zone. If they are all reified then (on a 64 bit system), that is less than 1Kb. If the process needs a name, or per-process variables, or actually does something that requires a stack, the memory requirement grows, with stack depth and object allocation within a context being the main drivers. I offer a guess of 5kb for a more realistic process than the 1Kb minimum (and it would be more if it were running THAPI calls). Stack space for an actively-running process comes from the stack zone, shared between all processes (can be reallocated at boot time). A process with a stack too deep to fit in the stack zone (or one that is relatively inactive) gets swapped out of the stack zone into context objects (limited only by how much object memory you can allocate). HTH Niall Ross On 02/03/2022 08:47, Annick wrote: > Hi, > > I was attending yesterday a talk on the Java Loom project, which aims at implementing virtual threads (instead of OS threads) in Java. > In particular I learned that any Java thread allocates 2M in memory, which limits considerably the physical number of threads in a server. > Does anyone know the comparison between Smalltalk processes and Java virtual threads ? > > > > <https://urldefense.com/v3/__https://www.fencingfox.com/__;!!DZ3fjg!pzGXXy1dwT8Msh8zic3dzrg51d7HGCdB-nhf_MDe0g9d8FMuTByeNAsAOTzpQexxJhBLRWc$ > > Annick FRON > +33 497021561 <tel:+33%20497021561> > +33 607114836 <tel:+33%20607114836> > [email protected] <mailto:[email protected]> > 977 avenue du Dr Lefebvre, 06270 Villeneuve-Loubet, France <https://urldefense.com/v3/__https://fencingfox.com/__;!!DZ3fjg!pzGXXy1dwT8Msh8zic3dzrg51d7HGCdB-nhf_MDe0g9d8FMuTByeNAsAOTzpQexxCesctcE$ > https://urldefense.com/v3/__https://fencingfox.com__;!!DZ3fjg!pzGXXy1dwT8Msh8zic3dzrg51d7HGCdB-nhf_MDe0g9d8FMuTByeNAsAOTzpQexxkxLQtbs$ <https://urldefense.com/v3/__https://fencingfox.com/__;!!DZ3fjg!pzGXXy1dwT8Msh8zic3dzrg51d7HGCdB-nhf_MDe0g9d8FMuTByeNAsAOTzpQexxCesctcE$ > > > -- This email has been checked for viruses by AVG. https://urldefense.com/v3/__https://www.avg.com__;!!DZ3fjg!vmxN8BvZCdbtAtbFNyPnJ8oYghoKub-qXl45RQlHRlBFomeq3Si5lx3M1SRf6aOtwrHby7A$