Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Questions by dd
0
votes
1
answer
1
Synchronization problem on single processor cpu
Consider the following multi threaded code. volatile static int flag1= 0, flag2= 0; // code for thread 1 (or T1) flag1 = 1; if (flag2==0) code1(); // end of code for T1 // code for thread 2 (or T2) flag2 = 1; if ( ... (). no method is invoked. both methods cannot be invoked! Also, what will be the answer if we remove the volatile type from the flags.
Consider the following multi threaded code.volatile static int flag1= 0, flag2= 0; // code for thread 1 (or T1) flag1 = 1; if (flag2==0) code1(); // end of code for T1 //...
379
views
asked
May 14, 2023
Operating System
operating-system
co-and-architecture
process-synchronization
+
–
0
votes
1
answer
2
Time complexity calculation
A complete binary tree is a binary tree whose all levels except the last level are completely filled and all the leaves in the last level are all to the left side. for example: Now, assume that, each of the nodes in this tree is represented by a structure struct node { ... R = R->right; } if(Lcnt == Rcnt) return 0; return func(root->left) + func(root->right); }
A complete binary tree is a binary tree whose all levels except the last level are completely filled and all the leaves in the last level are all to the left side.for exa...
1.3k
views
asked
Feb 10, 2022
Algorithms
algorithms
time-complexity
recursion
+
–
5
votes
1
answer
3
Counting number of pairs whose sum is less than k
How many pairs $(x,y)$ such that $x+y <= k$, where x y and k are integers and $x,y>=0, k > 0$. Solve by summation rules. Solve by combinatorial argument.
How many pairs $(x,y)$ such that $x+y <= k$, where x y and k are integers and $x,y>=0, k 0$.Solve by summation rules.Solve by combinatorial argument.
1.2k
views
asked
Jun 8, 2020
Combinatory
combinatory
summation
descriptive
+
–
0
votes
0
answers
4
Find correct statements
Find correct statements: The read system call to fetch data from a file always blocks the invoking process. During filesystem operations, if the file system implementation ensures that changes to data blocks of a file are flushed to disk before changes to ... interrupts on its CPU core for the duration that the spinlock is held, in both single core and multi core systems.
Find correct statements:The read system call to fetch data from a file always blocks the invoking process. During filesystem operations, if the file system implementation...
2.1k
views
asked
Jan 13, 2019
Operating System
operating-system
+
–
2
votes
1
answer
5
TLB hit ration and memory lookup time
Consider a system where TLB lookup time is $25$ ns and memory access time is $200$ ns, respectively. Assuming a virtual address space of $2$ KB, page size of $32$ bytes, and a PTE size of $2$ bytes, what is the minimum TLB hit ratio that results in an average v2p (virtual to physical) translation latency of $185$ ns?
Consider a system where TLB lookup time is $25$ ns and memory access time is $200$ ns, respectively. Assuming a virtual address space of $2$ KB, page size of $32$ bytes, ...
770
views
asked
Jan 13, 2019
Operating System
translation-lookaside-buffer
hit-ratio
+
–
0
votes
1
answer
6
process state in operating system
Consider a process P1 that is executing on a Linux-like OS on a single core system. When P1 is executing, a disk interrupt occurs, causing P1 to go to kernel mode to service that interrupt. The interrupt delivers all the disk blocks that unblock a ... user mode of P1. At this point in time, what are the states (ready/running/blocked) of processes P1 and P2 ?
Consider a process P1 that is executing on a Linux-like OS on a single core system. When P1 is executing, a disk interrupt occurs, causing P1 to go to kernel mode to serv...
1.1k
views
asked
Jan 13, 2019
Operating System
operating-system
process
+
–
1
votes
1
answer
7
fork and exec
what is the output of the following program? int ret = fork(); if(ret == 0) { exec(some_binary); // this call fails printf("child "); }else { wait(); printf("parent\n"); } Runtime Error child parent child parent
what is the output of the following program?int ret = fork(); if(ret == 0) { exec(some_binary); // this call fails printf("child "); }else { wait(); printf("parent\n"); }...
832
views
asked
Jan 13, 2019
Operating System
fork-system-call
operating-system
+
–
0
votes
0
answers
8
SpinLock in the kernel Mode
Consider a process in kernel mode that acquires a spin-lock. For correct operation, it must disable interrupts on its CPU core for the duration that the spin-lock is held, in both single and multi-core systems.[True / False]
Consider a process in kernel mode that acquires a spin-lock. For correct operation, it must disable interrupts on its CPU core for the duration that the spin-lock is held...
313
views
asked
Sep 15, 2018
Operating System
operating-system
+
–
0
votes
1
answer
9
Read system call
The read system call to fetch data from a file always blocks the invoking process.[True / False] [blocking means context switching to another process]
The read system call to fetch data from a file always blocks the invoking process.[True / False] [blocking means context switching to another process]
356
views
asked
Sep 15, 2018
Operating System
operating-system
+
–
0
votes
1
answer
10
Open file table
When a process opens a file that is already being read by another process, the file descriptors in both process will point to the same open file table entry.[True / False]. (open file table ?)
When a process opens a file that is already being read by another process, the file descriptors in both process will point to the same open file table entry.[True / False...
761
views
asked
Sep 15, 2018
Operating System
operating-system
file-system
+
–
0
votes
2
answers
11
Fork system call,open file table
The fork system call creates new entries in the open file table for the newly created child process. [True / False] [ what is open file table ? ]
The fork system call creates new entries in the open file table for the newly created child process. [True / False][ what is open file table ? ]
1.1k
views
asked
Sep 15, 2018
Operating System
operating-system
fork-system-call
+
–
0
votes
0
answers
12
Privileged modes
The four privileged modes (Ring 0 to Ring 3 as provided by x86) are the minimum levels of execution modes required for an operating system to operate correctly
The four privileged modes (Ring 0 to Ring 3 as provided by x86) are the minimum levels of execution modes required for an operating system to operate correctly
146
views
asked
Sep 13, 2018
Operating System
operating-system
non-gate
+
–
0
votes
0
answers
13
System Call
Illustrate the sequence of events/steps for invocation and execution of a system call. Starting from the user level call and back.
Illustrate the sequence of events/steps for invocation and execution of a system call. Starting from the user level call and back.
213
views
asked
Sep 13, 2018
Operating System
operating-system
non-gate
+
–
1
votes
1
answer
14
Estimate the average time to access data from memory
Estimate the average time to access data from memory with the following information, page fault service time = $2$ ms, memory access time = $200$ ns, $10$ page faults for every $10^6$accesses, TLB hit rate = $50\%$, ... to execute the page fault handler and update the v2p mapping (via possible evictions of other pages, reading from disk etc.)
Estimate the average time to access data from memory with the following information, page fault service time = $2$ ms, memory access time = $200$ ns, $10$ page faults for...
351
views
asked
Sep 13, 2018
Operating System
operating-system
non-gate
+
–
0
votes
0
answers
15
Interrupt handling
Give an example each for a hardware interrupt, an explicit software interrupt, and an implicit software interrupt, and discuss the possible operations as part of the interrupt handler.
Give an example each for a hardware interrupt, an explicit software interrupt, and an implicit software interrupt, and discuss the possible operations as part of the inte...
413
views
asked
Sep 13, 2018
Operating System
interrupts
operating-system
non-gate
+
–
0
votes
0
answers
16
System call
A system call operates in a process context. Give an example and explain this statement.
A system call operates in a process context. Give an example and explain this statement.
139
views
asked
Sep 13, 2018
Operating System
operating-system
non-gate
+
–
0
votes
1
answer
17
Virtual address space
A one-to-one mapping of the entire physical address space to a process's virtual address space is a correct address translation solution. True/False. Explain.
A one-to-one mapping of the entire physical address space to a process's virtual address space is a correct address translation solution. True/False. Explain.
509
views
asked
Sep 13, 2018
Operating System
operating-system
memory-management
non-gate
+
–
0
votes
1
answer
18
Page Table
A page table based translation will always consume less memory to store translation meta-data, than a seg-mentation based solution. True/False. Explain.
A page table based translation will always consume less memory to store translation meta-data, than a seg-mentation based solution. True/False. Explain.
402
views
asked
Sep 13, 2018
Operating System
memory-management
paging
operating-system
non-gate
+
–
0
votes
0
answers
19
Context Switch : kernel stack-user stack
Consider the following events that happen during a context switch of process $P$ to (user mode of) process $Q$, triggered by a timer interrupt that occurred when $P$ was executing in a Unix like operating system. Arrange the events in the chronological ... the kernel address space of $Q$ to the user address space of $Q$ (E) The OS scheduler code is invoked.
Consider the following events that happen during a context switch of process $P$ to (user mode of) process $Q$, triggered by a timer interrupt that occurred when $P$ was ...
696
views
asked
Aug 28, 2018
Computer Networks
operating-system
iitb
+
–
0
votes
0
answers
20
Wireless network media access protocol : RTS CTS and its problems
Four wireless nodes are placed on a straight line (see Figure $1$). Let $D(i, j)$ denote the distance between nodes $i$ and $j$. Each node has a circular communication range of $r = 1.5R$. This means that a ... $a$. Explain why this is true. Make any reasonable assumptions and state them clearly. (A rough explanation will do.)
Four wireless nodes are placed on a straight line (see Figure $1$). Let $D(i, j)$ denote the distance between nodes $i$ and $j$. Each node has a circular communication ra...
455
views
asked
Aug 28, 2018
Computer Networks
computer-networks
iitb
+
–
Page:
1
2
3
4
5
6
...
10
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register