Explain what happens when | Computer Science homework help

  

1. Explain what happens when the following statements are executed x = 0; if ( x == fork()) printf(“CSC 389\n”);

2. Semaphores are used to control access to resources. 

a. Explain what happens when the following pseudo code is executed.

3. Explain in detail what happens when each of the following statements are executed. You may assume all variables have been properly declared and this code.