Question
Option 4 : Both threads share the address space, so T2 sees the updated variable and both share the open file descriptor / दोनों थ्रेड एड्रेस स्पेस साझा करते हैं, अतः T2 अद्यतन वेरिएबल देखता है और दोनों फाइल डिस्क्रिप्टर साझा करते हैं
Detailed Solution
सही उत्तर Both threads share the address space, so T2 sees the updated variable and both share the open file descriptor / दोनों थ्रेड एड्रेस स्पेस साझा करते हैं, अतः T2 अद्यतन वेरिएबल देखता है और दोनों फाइल डिस्क्रिप्टर साझा करते हैं है।
Question:
Two threads T1 and T2 belong to the same process. T1 writes to a global variable and T2 opens a new file. Which statement is correct? / एक ही प्रोसेस के दो थ्रेड T1 और T2 हैं। T1 एक ग्लोबल वेरिएबल में लिखता है और T2 एक नई फाइल खोलता है। कौन-सा कथन सही है?
Correct Answer: Both threads share the address space, so T2 sees the updated variable and both share the open file descriptor / दोनों थ्रेड एड्रेस स्पेस साझा करते हैं, अतः T2 अद्यतन वेरिएबल देखता है और दोनों फाइल डिस्क्रिप्टर साझा करते हैं
Threads of one process share code, data (globals) and open files; each thread privately owns only its stack, registers and program counter. So T2 immediately sees the global change and can use the file T2 opened. / एक प्रोसेस के थ्रेड कोड, डेटा और खुली फाइलें साझा करते हैं; केवल स्टैक, रजिस्टर और प्रोग्राम काउंटर निजी होते हैं।