Explain briefly differences between process kernel


Assignment 1 -

Part I - Multiple choice, True/False and fill in blank:

1) Pipes are _______ persistent and Semaphores are ________ persistent.

2) Socket: to receive messages, a UDP client can use either recv( ) or recvfrom() system calls T/F?

3) If a thread is detached then it cannot be joinable T/F?

4) When a thread waits on a condition variable, its lock on the associated mutex will be be released T/F?

5) A process is zombte for the period of time from its creation to the time the parents issues a wait on it T/F?

6) Condition variable is a signaling mechanism associated with mutex T/F?

7) Pipes: there is no need that a process has to be waiting for a message to arrive T/F?

8) Semaphore values are stored in kernel and semaphore operations are performed in kernel mode T/F?

9) The semaphore command: semct1 (semid2, ANY, SETALL, 1) does the following:

(a) sets the value of the 1st semaphore in the semaphore set semid2 to 1.

(b) sets the value of all semaphores in she semaphore set semid2 to 1

(c) sets the value of the 1st semaphore in the semaphore set semid2 to 2.

(d) sets the value of the semaphore semid2 to 1.

(e) none of the above.

10) The semaphore command: semct(semid3, 2, SETVAL, 5) does the following.

(a) set the value of the semaphore semid3 to 5.

(b) sets the value of all semaphore in semid3 to 5.

(c) sets the value of the 3rd semaphore in the semaphore set semid3 to 5.

(d) set the value of dm first two semaphores in the semaphore set semid3 to 5

(e) now of the above.

11) _______ is a connection-oriented transport layer protocol.

12) A zombie process relinquishes all its resources including its slot in the process table; T/F?

13) Private class members are accessible outside class; T/F?

14) The types int, float, double and char are called primitive types; T/F?

15) String objects in Java are immutable: they cannot be modified after they are created. T/F?

16) Variables of type int can contain either signed or unsigned values: True or False?

17) Primitive-type names are keywords and must appear in all uppercase letters; T/F?

18) What is the purpose of the keyword void when used as the return type for the main method?

19) List the primitive types in Java.

20) To overload constructors, simply provide multiple constructor declarations with differing signatures and it is allowed in Java T/F?

Part II - Answer the following questions

1) Explain briefly differences between process, kernel, filesystem, persistence and give examples.

2) What are the possible return values of fork and what does each one mean?

3) A newly created process with fork () will be associated with (will executive) which program?

4) All threads of one process share (have in common) the following items: ................... while each thread has its own (not shared) ...............................              

5) Define pthreads? (2 - 3 lines)

6) The simplified shell algorithm in UNIX is simple algorithm that accept a command from the user and executes it (as discussed in the class). User can use the symboo '&' after the command. Modify the simplified shell algorithm to handle.

7) Write a pseudo-cede for the wait and signal operations in conditions variable.

8) Write down the steps (including the system calls) to exchange information using message queues.

Assignment 2 - Programming

1) Compile and run the two multithreading programs that we discussed in the class:

(a) First one is the threads program listed on slides numbers 22-26 of Threads slides. You need to change the values of MAXNITEMS and MAXNTHREADS to smaller numbers.

(b) Program multiple producers - single consumer with mutexes and condition variables, on threads slides numbers 31-35. You can change the values of MAXNITEMS and MAXNTHREADS to smaller (and more manageable) values. Provide screen shots showing successful compile and run with sample output.

2) You need to implement multiple producers multiple consumers work together as follows:

-producers and consumers work on a shared buffer called Buff with size of 200 elements

-Multi - threading in C and Unix

-use semaphores and condition variables.

-This is individual assignment (no groups).

-Each producers fills an entry of Buff with r (where r is a random number and I <= r <=10)

-The two consumers C1 and C2 can consume from Buff as follows: -- any Buff entry with value 5 or less can be consumed by either C1 or C2

-any Buff entry with value 6 or more can be consumed by C1 if number of number is odd and by C2 if the number is even.

-record the log of how many Buff entries each producer has filled. The winner is the producer that fills the most number of entries.

-The winner of C1 and C2 is the consumer that consumes the most number of entries.

Attachment:- Assignment.rar

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Explain briefly differences between process kernel
Reference No:- TGS01610581

Expected delivery within 24 Hours