Preview

computer hardware and netwoking question papers

Good Essays
Open Document
Open Document
735 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
computer hardware and netwoking question papers
Operating Systems

Q.1. Consider the following Snapshot of a System.

Allocation Max Available A B C D A B C D A B C D P0 0 0 1 2 0 0 1 2 1 5 2 0 P1 1 0 0 0 1 7 5 0 P2 1 3 5 4 2 3 5 6 P3 0 6 3 2 0 6 5 2 P4 0 0 1 4 0 6 5 6

Use Banker’s algorithm.
a) What is the content of matrix need ?
b) Is the system in a safe state ?

Implement Banker’s algorithm using a C program.

Solution :
/*-------------Banker's algorithm---------------------------------*/
#include
#include
#include

#define MAX_PROC 10
#define MAX_RESO 10

#define TRUE 1
#define FALSE 0 void main()
{
int n; //Let n be the number of processes in the system int m; //Let m be the number of resource types int available[MAX_RESO]; //Number of available resources //of each type int max[MAX_PROC][MAX_RESO];//Maximum demand of each process int allocation[MAX_PROC][MAX_RESO]; //No. of resources of each type //currently allocated to each process int need[MAX_PROC][MAX_RESO]; //Remaining resource need of each process

void assign_available(int available[], int m); void assign_max(int max[][MAX_RESO], int n, int m); void assign_alloc(int allocation[][MAX_RESO], int n, int m); void cal_need(int need[][MAX_RESO], int max[][MAX_RESO], int alloc[][MAX_RESO], int n, int m); int safety(int available[], int max[][MAX_RESO], int alloc[][MAX_RESO], int need[][MAX_RESO], int n, int m); clrscr(); printf("\nEnter no. of processes : "); scanf("%d", &n); if(n > MAX_PROC) { printf("\nNumber of processes cannot be greater than %d",MAX_PROC); exit(0); }

printf("Enter no. of resource types: "); scanf("%d", &m); if(m > MAX_RESO) { printf("\nNumber of resources cannot be greater than %d",MAX_RESO); exit(0); }

You May Also Find These Documents Helpful

  • Good Essays

    Some OS routines directly support application programs as they run and thus must be resident. Other transient routines are stored on disk and read into memory only when needed. Fixed-length partitions can also be used to allocate the set amount of memory that a particular program needs to run. Under dynamic memory management, the transient area is treated as a pool of unstructured free space. When the system decides to load a particular program, a region of memory just sufficient to hold the program is allocated from the pool. Using segmentation, programs are divided into independently addressed segments and stored in noncontiguous memory. Paging breaks a program into fixed-length pages.…

    • 7085 Words
    • 29 Pages
    Good Essays
  • Better Essays

    NETW471 Course Project

    • 2998 Words
    • 9 Pages

    Blue-tooth is a great emerging technology being used today, which also has potential for much more uses than the tradition bluetooth headset. Bluetooth connects gadgets together, helping users listen to music, talk on phones without having to deal with frustrating cords and wires. To understand how a Bluetooth connection works, I will use an example such as a phone connected to wireless speaker. First, each device is equipped with Bluetooth connectivity, a feature that requires both software and hardware components. On the hardware side, an antenna-equipped chip in both devices sends and receives signals at a specific frequency. The software interprets incoming Bluetooth signals and sends them out in ways other devices can read and understand. In the case of the wireless speaker, the phone will know how to send audio files and information in a format that the speaker understands, while the speaker can interpret these signals–as well as other indicators such as volume and track controls–from the phone.…

    • 2998 Words
    • 9 Pages
    Better Essays
  • Better Essays

    #include #include float avg_wt,avg_tt; int i = 0,ttl_wt=0,ttl_tt=0,qt; struct process { int prn; char type; int bt; int wt; int tt; struct process *nxt; }*stfor,*stbck,*np,*endfor,*endbck,*temp; void ins_node(struct process *np) { if(np->type == 'f') { if(stfor == NULL) stfor = endfor = np; else { endfor->nxt = np;…

    • 401 Words
    • 2 Pages
    Better Essays
  • Satisfactory Essays

    Stallings, W. ((2015)). Operating Systems: Internal and Design Principles, 8e. Retrieved from The University of Phoenix eBook Collection Database.…

    • 472 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    When a CPU is composed of two or more processors, each one is referred to as a(n) ________.…

    • 2490 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Which IEEE wireless networking protocol was ratified in 2009 and has a maximum defined data rate of 600 Mb/sec?…

    • 778 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    a) The sale of the tables and chairs represents the total profit. The production plan includes oak tables and chairs, cherry tables and chairs, and pine tables and chairs.…

    • 202 Words
    • 19 Pages
    Satisfactory Essays
  • Good Essays

    Question 7: How do local area networks (LANs) differ from metropolitan area networks (MANs), wide area networks (WANs), and backbone networks (BNs)?…

    • 686 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Bca Cs-63

    • 1608 Words
    • 7 Pages

    Consider the following set of processes that arrive in the ready queue at the same time:…

    • 1608 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    Show all the possible interleavings of the execution of preceding two processes (Show this by giving execution “traces” in terms of the atomic statements)…

    • 810 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Instructions to Student

    • 1034 Words
    • 5 Pages

    1. This Assignment is a Group Assignment of not more than 2 students and consists of 5 pages with 5 Questions only.…

    • 1034 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Networking

    • 477 Words
    • 2 Pages

    13. To represent 1024 colors, we need log21024 = 10 bits. The total number of bits are, therefore, 1200  1000  10 = 12,000,000 bits…

    • 477 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Computer Networking Plan

    • 1086 Words
    • 5 Pages

    A VLAN (virtual local area network) is a logical grouping of network devices (servers, workstation, laptops, etc.) that generally have something in common, such as the same department or access to a particular server. Although devices in VLANs are virtually separated from each other by being placed on different segments, they can still communicate with each other as if they were on the same segment. VLANs are a feature of network switches and are configured within the switch itself. Implementing a VLAN can provide several benefits for the company’s network. A major benefit of using VLAN is increased performance. By grouping users into virtual networks, broadcast domain are created. This allows broadcast traffic destined for a particular network to be limited to only the broadcast domain/VLAN corresponding to that specific network, instead of being sent throughout the entire network. Additionally, there will also be less traffic to route and reduced router latency. By creating a VLAN and as such a broadcast domain for each department, the company will be able to decrease the bandwidth consumption experienced with all the departments in a single broadcast domain.…

    • 1086 Words
    • 5 Pages
    Better Essays
  • Good Essays

    Packet Switching

    • 655 Words
    • 3 Pages

    Kleinrock was born into a Jewish family in Manhattan on June 13 1934. Kleinrock’s interest in electrical engineering began at the age of 6 while reading a superman comic book. When the young engineer reached the centerfold he stumbled upon a paper showing him how to build a crystal radio. Struck with awe and curiosity he began t gather the material he would need to complete the task. As he collected the material he noticed that he would need to go out and buy a “variable capacitor”. After the piece was obtained and the radio was built the young boys mind was stimulated and an engineer was born.…

    • 655 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Networking

    • 4941 Words
    • 20 Pages

    NuggetLabs Industries is growing significantly. Due to space limitations, five employees currently share single cubicles…at the same time. While this is great for team building, these space limitations are now impacting business productivity. NuggetLabs has now leased an additional office building roughly 20Km from their headquarters location. While this office will eventually connect to the HQ office, it will initially be set up independently. NuggetLabs Industries has heard rumors of your ninja-like network consultation skills and has agreed to pay you an excessive amount of money to design and build their network infrastructure.…

    • 4941 Words
    • 20 Pages
    Good Essays