Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Write a LINUX C code for Banker’s
Note: Consider a system with five processes (P0–P4) and three resources (A, B, C).
There are 9 instances of resource type A, 4 instances of resource type B, and 6
instances of resource type C.
(provide ubuntu screenshots)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Similar questions
- 2) As discussed in the class on the implementation of subprogram (call and re- turn). Which one of the statements is NOT correct? A. The Activation record format and size are dynamic B. The dynamic link points to the top of an instance of the activation record of the caller C. An activation record instance is dynamically created when a subprogram is called D. Activation record instances reside on the run-time stackarrow_forwardAn actual working program in C that transfers contents of a file into a linked list and then performs insertion, updation, deletion and search operation on the contents of the file through a linked list. The contents of the file should be treated as a string. And all operations performed on the linked list should reflect on the file. The format of the file is: 112.22.33.44 Baker 101.32.11.23 Parson and so on.. and each line in the file should be treated as a string.arrow_forwardThis is some code in C for quicksort. The quicksort works correctly, but I am trying to implement multithreading. I am trying to run the recursive calls in parallel with a limit on how much threads can be running at one time (set by the global variable 'maximumThreads'). My logic is incorrect with managing how many threads can be ran at the same time. The part that I need you to look at is after the for loop in quick sort, where I have my logic for the mutex and the conditional variable. Right now when I run my code, the program runs without stopping. I would like help with correctly implementing this. #include <stdlib.h>#include <string.h>#include <pthread.h>#include <stdio.h>#define SORT_THRESHOLD 40typedef struct _sortParams {char** array;int left;int right;int* currentThreads;pthread_mutex_t* mutex;pthread_cond_t* cond_var} SortParams;static int maximumThreads; /* maximum # of threads to be used *//* This is an implementation of insert sort, which although…arrow_forward
- Write a C program that takes a list of command line arguments, each of which is the full path of a command (such as /bin/ls, /bin/ps, /bin/date, /bin/who, /bin/uname etc). Assume the number of such commands is N, your program would then create N direct child processes (ie, the parent of these child processes is the same original process), each of which executing one of the N commands. You should make sure that these N commands are executed concurrently, not sequentially one after the other. The parent process should be waiting for each child process to terminate. When a child process terminates, the parent process should print one line on the standard output stating that the relevant command has completed successfully or not successfully (such as "Command /bin/who has completed successfully", or "Command /bin/who has not completed successfully"). Once all of its child processes have terminated, the parent process should print "All done, bye-bye!" before it itself terminates. Note: do…arrow_forwarduse java programming language to explain if needed, please be clear, take your time, thanksarrow_forwardFill in the blanks:5. The ( 6 ) is used to implement mutual exclusion where it can be decremented by aprocess and incremented by another, but the value must either be 0 or 1.6. If deadlock prevention approach is used to deal with deadlocks in a system, the ( 7 )condition can be prevented using the direct method.7. Two threads may share the memory space, but they cannot share the same ( 8 )8. Consider round-robin (RR) scheduling algorithm is implemented with 2 seconds timeslice and it is now selecting a new process; if we have 3 blocked processes (A, B, and C),and A has been waiting the longest, then A would need to wait a period of ( 9 ) secondsto be selected.9. In real-time systems, if a task appears at random times, then it is considered ( 10 ).arrow_forward
- Sockets are low-level networking interfaces between computers. Many programming languages come standard with socket libraries for creating socket connections. In this lab, we’ll study the usage of networking sockets in Python to write a custom client/server program. Client/Server source code as a ZIP or RAR file in D2L Word document outlining the description of your program. The word document should contain screenshots containing your name on the VM and reports of what’s occurring in them. Demonstrate your socket solution accomplishes the following: The client connects to the server Client and server successfully exchange messages Following the TCP stream in Wireshark Identifying the message sent in Wireshark Any additional functionality you created in your solution. please use python.arrow_forwardCreate a java class to represent a log message. The log message should include the following attributes:a. The severity of the message from least to most severe: DEBUG, INFO, WARNING, ERROR, or CRITICAL.b. The name of the module that has created the log.c. The timestamp at which the log was created in the format“YYYY/MM/dd HH:mm:ss.SSS” (see java.text.SimpleDateFormat).d. The message to be logged.e. A toString() method that returns a string in the format:[severity][timestamp][name] messagearrow_forwardThis is some code in C for quicksort. The quicksort works correctly, but I am trying to implement multithreading. I am trying to run the recursive calls in parallel with a limit on how much threads can be running at one time (set by the global variable 'maximumThreads'). My logic is incorrect with managing how many threads can be ran at the same time. The part that I need you to look at is after the for loop in quick sort, where I have my logic for the mutex and the conditional variable. Right now when I run my code, the program runs indefinitely. I would like help with correctly implementing this part. #include <stdlib.h>#include <string.h>#include <pthread.h>#include <stdio.h>#define SORT_THRESHOLD 40typedef struct _sortParams {char** array;int left;int right;int* currentThreads;pthread_mutex_t* mutex;pthread_cond_t* cond_var} SortParams;static int maximumThreads; /* maximum # of threads to be used *//* This is an implementation of insert sort, which…arrow_forward
- Multi-tasking can not be achieved with a single processor machine. True False 2. Async/Await is best for network bound operations while multi-threading and parallel programming is best for CPU-bound operations. True False 3. The following is a characteristic of an async method:The name of an async method, by convention, ends with an "Async" suffix. True False 4. Using asynchronous code for network bound operations can speed up the time needed to contact the server and get the data back. True False 5. Asynchronous programming has been there for a long time but has tremendously been improved by the simplified approach of async programming in C# 5 through the introduction of: The Task class True Falsearrow_forwardAnswer the following questions about activation records (stack frames). i. What information do activation records (stack frames) typically contain? ii. Suppose that the program only contains two functions f and g. Can we use only one activation record for each of f and g? Why?arrow_forwardConsider a computer system with multiple resources and concurrent processes competing for them. Deadlock is a situation that might arise in such a system. What conditions must hold simultaneously for a deadlock to occur in this system? A. Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait B. Mutual Exclusion, First Come First Serve, Circular Wait, Limited Resources C. Mutual Exclusion, Hold and Wait, Priority Inheritance, Circular Wait D. Hold and Wait, No Preemption, Circular Wait, Resource Optimizationarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY