News for hackers. Stuff that matters.
Re:Stack size invisibility in C and the effects on "portabil... by titzer on Tuesday September 28, 2021 @11:08AM (#28683680)
Yeah, I think there would be some overhead, because it doesn't look like pthread_create allows specifying a stack segment. But I wouldn't be using pthread_create (or any C library for that matter), because Virgil goes all the way down to kernel; there is no C environment.

I only experimented briefly[1] with getting Virgil threads to run on Linux. You need to call SYS_clone, which forks a lightweight process (i.e. shares all virtual memory), and specify a stack segment. The segment in question would of course, be mapped by Virgil and not have MAP_GROWSDOWN, so it could be made robust to stack overflow along the lines above.

[1] https://github.com/titzer/virgil/blob/master/apps/Multi/Mult...

There are no comments on this comment yet.