What are the possible return values of fork

Assignment Help Computer Engineering
Reference no: EM131226928

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

Reference no: EM131226928

Questions Cloud

What are the benefits or disadvantages of the technology : When should this encryption technology be used? Who are the users of the encryption technology? What are the benefits/disadvantages of this technology?
What is the cost of equity after recapitalization : Meyer & Co. expects its EBIT to be $75,000 every year forever. The firm can borrow at 12 percent. Meyer currently has no debt, and its cost of equity is 15 percent and the tax rate is 35 percent. The company borrows $152,000 and uses the proceeds ..
What gain would you expect him to find : An inverting op-amp circuit with the topology of Fig. 2.4 on page 65 of the Text, has Ri = 4.7 kΩ and R2 = 47 kn. What closed-loop gain would you expect? In the laboratory, a student accidentally exchanges these two resistors. What gain would you ..
Describe the firms original positioning strategy : Describe the firm's original positioning strategy and then describe the firm's revised positioning strategy. How did customers react to this change in positioning strategy - was it successful or not? Why?
What are the possible return values of fork : Explain briefly differences between process, kernel, filesystem, persistence and give examples. What are the possible return values of fork and what does each one mean
What is the pre-cise input voltage : What is the pre-cise input voltage, ub you would expect? (Hint: First, consider this question assuming that the gain (104) is very high. Then, refine your answer with a calculation in which a very small error correction is made).
How many solutions arc there : Design an op-amp circuit with a gain of -2 VN, using three 100 k Ω resistors. How many solutions arc there? What is the input resistance of each?
Design an inverting op-amp circuit with a gain : Design an inverting op-amp circuit with a gain whose magnitude is 10 VN using one 220 La resistor and another resistor no greater than 1 MΩ.
Design an amplifier with a gain of -20 vn : Design an amplifier with a gain of -20 VN, an input resistance of 100 kΩ, and no resistor greater than I ma. (Hint: you need more than 2 resistors! But not 4!)

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd