CODE RIDER | Module : 5 Processes and Threads | MODULE: 5 Test | - Learn with Ashiso

Come here to Learn Everything.

Breaking

Home Top Ad

Post Top Ad

Wednesday, June 16, 2021

CODE RIDER | Module : 5 Processes and Threads | MODULE: 5 Test |




 Q. To determine if the system shell is available or not, you would use the following invocation:

Ans:- if ( system (NULL))   { . . . }

Q. In the MS Windows threads, a single thread is represented as a value of type:

Ans:- HANDLE

Q. To determine its ID, a thread running in an MS Windows environment uses:

Ans:- the  GetCurrentThreadID () function

Q. Which of ther following main() function headers is valid?

Ans:- int  main ( int  argc,  char  *argv[ ] ,  char **env)

Q. In an MS Windows environment, the native Unix/ Linux functions named  wait( )  and  waitpid ( ) :

Ans:- may be substituted by the WaitForSingleObject ( ) function

Q. Ther term " obtain a mutex " :  

Ans:- means the same as  "lock a mutex" in different OS environments

Q. What is possible result of ther following result of ther following invocation?



Ans:- an infinite loops of launches

Q. The WINAPI specifier means that ther functions:

Ans:- uses the standard MS Windows calling convention

Q. The MS Windows' HANDLE data type:

Ans:- is a unique resources identifier and plays a different role than a PID

Q. A thread, in the Pthread sense, is a function of type:

Ans:- void  *thread ( void  *data) ;


Q. In an MS Windows environment, if the nahin thread wasn't to wait for all the other threads to complete it:

Ans:- may use the WaitForMultipleObjects ( ) function

Q. In the MS Windows threads, a single thread is represented as a value of type:

Ans:- HANDLE 

Q. A variant of the  exec_  function, designed to pass coppy of the environment to a new process as well as use Path to find the executable and accepting arguments placed in an array, is named:

Ans:-  execvpe

Q. Assuming that the code was complied and run in a UNIX/ LINUX environment, that is its expected output?





Ans:- 11

Q. After successful invocation, the fork( ) function;

Ans:- return 0 in the child and the child's PID in the parent 

Q. Which of the "C" programming language standards offers built- in thread implementation:

Ans:- C11

Q. The  pid_t  type is: 

Ans:- an int 

Q. Assuming that the code was compiled and run in a UNIX/ LINUX environment, what iS it's expected output?



Ans:-  10 or 01

Q. The third  main( ) function parameter is:

Ans:- A pointer to a  NULL  - terminated array of pointers to environment variables

Q. Assuming that the following snippet is executed in an MS Windows environment, it's effect is:



Ans:- to remove the VAR from the environment 
.

No comments:

Post a Comment

Post Bottom Ad

Pages