Похожие чаты

Here is my story about that. I am not sure about

the heap, but correct me if there is something wrong.

My question was:
Why the multithreaded process does not StackOverflow?

In this story, I am talking about pthread.
Facts:
1. When a process spawns a thread, its thread shares the same virtual memory address with the main process.
2. Every single thread has its stack.

These facts imply that a single process will have a stack size more than R_LIMIT_STACK.

> Because every single thread has its stack with the same size as the main process
> and the memory owned by the thread is also owned by the main process.

So what happens here?
> mmap is behind this strange limit stack violation.
> When the process spawns a thread with ptread_create, it also maps heap and plugs it to RSP register that is held by the thread.
> So it will not make your program StackOverflow because of spawning thread.
> Stack in the thread is actually heap that is mapped with MAP_STACK.

2 ответов

15 просмотров
Ammar-Faizi Автор вопроса

I could figure it out by using strace.

Ammar-Faizi Автор вопроса

I did, this is my conclusion in the case above, I could not find the article about that. So I would welcome for any correction.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта