Professional Documents
Culture Documents
Osassignment
Osassignment
2. (10 points) Run the code again this time in the background ( $ ./threads & ) Try
to terminate the program by sending a CTRL C signal. Explain the result.
^c
3. (10 points) What happens if the main thread does not wait for the other two threads?
4. (10 points) Determine the storage class (automatic, static, global, register) for
each variable in this program.
5. (10 points) Determine the memory segment (Text, Data, BSS, Stack, Heap) in the
process address space where memory is allocated for each variable in this program.
using size command we can find text, data, BSS size.
text = 2837 (size of file)
data = 664
BSS = 16
stack = 36
Here no dynamic allocation of memory so heap size will be 0.
OUTPUT: