Does each thread is created as a different process?

Created at 2020-12-25 18:26:40

ab92c0c4a21fe89187cdb0ab237509fc.png
I create a two threads and used a global variable to communicate between them but it failed. I want to know that if each thread is a different process or a sub threads in a single process.

更多

Follower
0
Views
1.6k
3 Answers
DH04
DH04 2020-12-25

Different from PC OS,it's hard to describe the rt-thread's thread is a process or a sub-threads, these points may help you understand it:

  1. different thread in rt-thread share the same memory space, so the global variable and other ram space are accessible between threads
  2. each thread has its own context, so the general registers, local variables, are separated
varun
varun 2020-12-28

I fixed the problem myself. After writing the else part the program ran correctly without any error.

labronm
labronm 2天前

Wow, what a fantastic discussion on threading in RT-Thread! I really appreciate how you delved into whether each thread is treated as a separate process. This brings up some intriguing points about resource management and Geometry Dash Wave efficiency.

Write Your Answer

Log in to publish your answer,Click here to log in.

Create
Post

Share