Thread shares with other threads belonging to the same process its ______.
2024
Thread shares with other threads belonging to the same process its ______.
- A.
thread ID
- B.
program counter
- C.
code section and data section
- D.
More than one of the above
- E.
None of the above
Attempted by 475 students.
Show answer & explanation
Correct answer: C
In a process, multiple threads share certain resources to enable efficient execution. Threads share the code section (the program instructions) and the data section (global and static variables) because they belong to the same process. However, each thread has its own unique thread ID and its own program counter to track the current instruction being executed. This allows threads to run independently while sharing the same memory space for code and data.
हिन्दी उत्तर: एक प्रोसेस में कई थ्रेड्स एक दूसरे के साथ कुछ संसाधनों को साझा करते हैं। थ्रेड्स कोड सेक्शन (प्रोग्राम निर्देश) और डेटा सेक्शन (ग्लोबल और स्टैटिक वेरिएबल्स) को साझा करते हैं क्योंकि वे एक ही प्रोसेस के होते हैं। हालांकि, प्रत्येक थ्रेड का अपना अद्वितीय थ्रेड आईडी और अपना प्रोग्राम काउंटर होता है जो वर्तमान निर्देश को ट्रैक करता है। यह थ्रेड्स को स्वतंत्र रूप से चलने की अनुमति देता है जबकि कोड और डेटा के लिए एक ही मेमोरी स्पेस साझा करता है।