RTOS Questions
RTOS Questions
Q2. What isthe difference between a Ã¢â ¬Ë threadâ⠬⠢ and a Ã¢â ¬Ë processâ⠬⠢?
Ans. A process is a collection of virtual memory space, code, data, and system r
esources. A thread is code that is to be serially executed within a process. A p
rocessor executes threads, not processes, so each application has at least one p
rocess, and a process always has at least one thread of execution, known as the
primary thread. A process can have multiple threads in addition to the primary t
hread. Prior to the introduction of multiple threads of execution, applications
were all designed to run on a single thread of execution.
When a thread begins to execute, it continues until it is killed or until it is
interrupted by a thread with higher priority (by a user action or the kernel s thr
ead scheduler). Each thread can run separate sections of code, or multiple threa
ds can execute the same section of code. Threads executing the same block of cod
e maintain separate stacks. Each thread in a process shares that process s global
variables and resources.
Other:
What port is SSH?
What port is DNS? Is it UDP or TCP?
What does it mean to setuid ?
Answer to Question 3
Data structures that contain information about the files that are created when u
nix file systems are created.Each file has an i-node & is identified by an inode
number(i-number) in the file system where it resides.inode provides important i
nformation on files such as group ownership,acess mode(read,write,execute permis
sions).
marshelling.
The process of gathering data and transforming it into a standard format before
it is transmitted over a network so that the data can transcend network boundari
es. In order for an object to be moved around a network, it must be converted in
to a data stream that corresponds with the packet structure of the network trans
fer protocol. This conversion is known as data marshalling. Data pieces are coll
ected in a message buffer before they are marshaled. When the data is transmitte
d, the receiving computer converts the marshaled data back into an object.
A mutex is owned by a thread/process. So once a thread locks it, then other thre
ads/processes will either spin or block on the mutex. Whereas, semaphore allows
one or more threads/processes to share the resource.
difference between linking and loading:
\
\\\
\\\
What is Mutex Object?
Ans:- A mutex object is a synchronization object whose state is set to signaled
when it is not owned by any thread, and non-signaled when it is owned. For examp
le, to prevent two threads from writing to shared memory at the same time, each
thread waits for ownership of a mutex object before executing the code that acce
sses the memory. After writing to the shared memory, the thread releases the mut
ex object.
\\
What is semaphore?
Ans:- A semaphore object is a synchronization object that maintains a count betw
een zero and a specified maximum value. The count is decremented each time a thr
ead completes a wait for the semaphore object and incremented each time a thread
releases the semaphore. When the count reaches zero, no more threads can succes
sfully wait for the semaphore object state to become signaled. The state of a se
maphore is set to signaled when its count is greater than zero, and non-signaled
when its count is zero. The semaphore object is useful in controlling a shared
resource that can support a limited number of users. It acts as a gate that limi
ts the number of threads sharing the resource to a specified maximum number.
\\\
\\\
Mutex :
Mutex is the synchronized object used to achive serialized resource access i.e.
one by one to single resource.
eg : In an interview, only one person can interview a candidate, after his compl
etion one more person will come & interview the same candidate.
Semaphore:
Semaphore is the synchronized object used to achive serialized resource access i
.e. one by one to the N number of resource.
eg : In an interview, one person is interview 2 or more candidates sewuentially,
after his completion one more person will come & interview the same candidates.
\\
What is INODE?
ans:It contains information about UNIX file system.ie when the file can be creat
ed and also gives the owership of the file,and permission level.inode number (i-
number) is reside over the files,it can be found using the command ls-l
Question what is major concerns about any RTOS selection ?
Question Submitted By :: Sumeet4interview
I also faced this Question!! Rank Answer Posted By
Re: what is major concerns about any RTOS selection ?
Answer
# 1 There are two major reson to consider before selecting any RTOS
1) Interuppt latency
2) Footprint (size of the executable which is generated
after compiling)
3) Context switching time is also considered as vital
element in selection
Re: What is the difference between Hard and Soft real-time systems ?
Answer
# 1 Often a hard real-time system operates on a preemptive,
context switching operating system where tasks will be
switched in and out execution state upon its defined and
scheduled time slots to maintain its real-time
characteristics. A soft real-time system, often denotes a
system that attempts to meet all time constaints imposed by
its tasks or operations or applications by enjoying the
powerful system resources such as high clock rate, faster
processors, speedy cache, and lightening buses. Yet, it is
still a 'soft' real-time system because some critical tasks
might be delayed due to some system-oriented processes that
are bulky and time-consuming and not preemptive.
Is This Answer Correct ? 19 Yes 13 No
2 Kwrtos
Re: What is the difference between Hard and Soft real-time systems ?
Answer
# 2 In Real time system correctness of an operation depends not
only on the logical correctness but it should be
deterministic. Real time system are of two types, hard and
real. In hard real time system any output after the
deadline should be treated as useless,so it lead to
complete failure. But in soft realtime some late answer
also consider as a right answer, it tolerate such lateness
Is This Answer Correct ? 41 Yes 8 No
2 Prajesh
Re: What is the difference between Hard and Soft real-time systems ?
Answer
# 3 A hard real-time system guarantees that critical tasks
complete on time. This goal requires that all delays in the
system be bounded from the retrieval of the stored data to
the time that it takes the operating system to finish any
request made of it. A soft real time system where a critical
real-time task gets priority over other tasks and retains
that priority until it completes. As in hard real time
systems kernel delays need to be bounded
Question What is the difference between Hard and Soft real-time systems ?
Question Submitted By :: Tribhuvan Sharma
I also faced this Question!! Rank Answer Posted By
Re: What is the difference between Hard and Soft real-time systems ?
Answer
# 1 Often a hard real-time system operates on a preemptive,
context switching operating system where tasks will be
switched in and out execution state upon its defined and
scheduled time slots to maintain its real-time
characteristics. A soft real-time system, often denotes a
system that attempts to meet all time constaints imposed by
its tasks or operations or applications by enjoying the
powerful system resources such as high clock rate, faster
processors, speedy cache, and lightening buses. Yet, it is
still a 'soft' real-time system because some critical tasks
might be delayed due to some system-oriented processes that
are bulky and time-consuming and not preemptive.
Is This Answer Correct ? 19 Yes 13 No
2 Kwrtos
Re: What is the difference between Hard and Soft real-time systems ?
Answer
# 2 In Real time system correctness of an operation depends not
only on the logical correctness but it should be
deterministic. Real time system are of two types, hard and
real. In hard real time system any output after the
deadline should be treated as useless,so it lead to
complete failure. But in soft realtime some late answer
also consider as a right answer, it tolerate such lateness
Is This Answer Correct ? 41 Yes 8 No
2 Prajesh
Re: What is the difference between Hard and Soft real-time systems ?
Answer
# 3 A hard real-time system guarantees that critical tasks
complete on time. This goal requires that all delays in the
system be bounded from the retrieval of the stored data to
the time that it takes the operating system to finish any
request made of it. A soft real time system where a critical
real-time task gets priority over other tasks and retains
that priority until it completes. As in hard real time
systems kernel delays need to be bounded
Re: what are the rules u follow when u r writing critical section of code?
Answer
# 2 1. Operation Must be Atomic
2. The process which are not currently executing its
rtemainder section are only allowed to make request to
execute its critical section
Is This Answer Correct ? 6 Yes 0 No
0 Vineesh Mca@tkm
Re: what are the rules u follow when u r writing critical section of code?
Answer
# 3 1.The operation must be atomic
2.The atomicity is ensured by disabling the interrupts and
immediately after crictical section enabling the
interrupts..here slight precausion has to be taken i.e do
not forget the enabling of interrupts ....
Is This Answer Correct ? 0 Yes 0 No
0 Rk
Re: what are the rules u follow when u r writing critical section of code?
Answer
# 4 Always keep your execution code as minimal as possible in
the critical section.
Never use blocking calls in the critical section.
Is This Answer Correct ? 3 Yes 0 No
0 Bb
Re: what are the rules u follow when u r writing critical section of code?
Answer
# 5 a) Use Atomic Instructions
b) Remember to enable interrupts
c) Make the critical section code as small as possible.
(Prefer not more than 20 instructions)
d) Prefer not to call other functions from the critical
section. if u r calling, see that there is no critical
section in the other function too. Critical section is
bounded by Disable Interrupt and Enable Interrupt.
Check the example below.
fnA()
{
/* Critical Section Start */
Disable_Interrupt();
Some Instructions A ....
Call FnB();
/* do Something B */
Some Instructions B ....
/* Critical Section End */
}
fnB()
{
/* Critical Section Start */
Disable_Interrupt();
Some Instructions ..
Enable_Interrupts();
/* Critical Section End */
}
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 2 Pending state
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 3 When a process is waiting for event it is in blocked state
when a process is waiting for resource it is in pending
state
Is This Answer Correct ? 9 Yes 2 No
0 Guest
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 4 Sorry, the answer is
Blocked state
Is This Answer Correct ? 3 Yes 5 No
0 Senthil
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 5 Pending(term used in RTOS) and Blocked(term used in Windows)
are the same state.
Is This Answer Correct ? 5 Yes 3 No
0 Sunita
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 6 They have asked the state of processor, so.. should it be
blocked/pending or it should be running?? as there is a
possiblity that processor may be executing other processes
right??
Is This Answer Correct ? 3 Yes 3 No
0 Ramu
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 7 If the system is waiting for an event and no other process
is running, then the processor will be running the 'system
idle loop', as a state we can say its Pending or Blocked.
Is This Answer Correct ? 4 Yes 3 No
0 Kiran.m.v
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 8 processor will enter in "idle loop" in which "sleep"
instruction will be executed to move processor to sleeping
i.e. power saving mode.
In this state processor can accept interrupts and come out
of sleeping state.
So actually processor "do nothing" in this situation.
Is This Answer Correct ? 3 Yes 6 No
0 Tejas Gawade
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 9 it is known as waiting state
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 10 Since they have asked for the state of the processor it
will be in the idle state.idle state is nothing but a
lowest priority which is executed to keep the processor
busy always...
Is This Answer Correct ? 4 Yes 1 No
0 Nithin Ganesh
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 11 The answer 6 seems to be closer. It all depends on whether
the system is multitasking or not.
If it is multitasking: The process that is waiting for an
event to occur and in user mode, there are other processes
waiting to be scheduled then possibly one of the processes
will be eventually scheduled by preempting the current process.
If it is multitasking and the process is waiting for an
event to occur and in kernel mode?????
If it is not multitasking: Very trivial case needs no
elaboration.
Is This Answer Correct ? 2 Yes 0 No
0 Kum
Re: What is the state of the processor, when a process is waiting for some ev
ent to occur?
Answer
# 12 I don't think there is any relation between processor state
and process state. They are independent. However they are
loosely coupled through the operating system. Assuming that
the OS you are using is multi-processing OS, then, whenever
a process P1 is waiting for some resource, the OS scheduler
puts P1 in sleep mode and allows other scheduled processes
to run. Hence, the processor state will always be running.
In case, there are no more processes to run, then, the
processor enters NOP or WAIT state.
///////////
Object-Orientated Concepts, UML interview Questions
-- Useful eBooks --
How To Naturally Regrow Lost Hair.
Dry Itchy Scalp & Dandruff Causes & Remedies.
-- Sponsored Links --
Your Ad Here