1/72
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
pthread_join() function is a non-blocking function.
False
Using QNX Message Passing, what will a server receive messages on?
Channels
Consider this scenario. A thread of priority 10 is running, and now it becomes blocked. Will this thread lose its priority?
The thread will not lose its priority; when it unblocks, the thread will be placed at the end of the ready queue of all threads with priority of 10.
Which form of IPC provided by the QNX Neutrino kernel usually results in the termination of a process?
Signals
Identify the two types of semaphores that are supported in QNX's Neutrino.
Named and unnamed
Consider the following scenario regarding threads. Thread X unblocks and then Y unblocks. When will X run?
Priority: Ready: Blocked:
50 Y(r)
49 A(f) X(r)
48 Z(r), B(r) C(f)
When both A and Y complete or block.
QNX's Neutrino provides a scheduling algorithm named 'other'. Which scheduling algorithm listed below is the same as 'other'?
Round Robin
What is the default password for qnxuser?
qnxuser
Suppose your "Hello World" program from Lab 2 is running as a process, and its PID is 1234. Sending a SIGUSR2 signal to 1234 will terminate the process.
True
What is the name given to the microkernel and process manager in QNX?
procnto
What is the correct order of pseudo-code (or PDL) for this server?
ChannelCreate(); do { MsgReceive(); perform processing; MsgReply(); } while(true);
Which function do you call to decrement a semaphore?
sem_wait()
QNX Message Passing is ____________ based and has ____________ communication.
Client-server, bidirectional
Suppose you write a program that calls the fork() function. At which point in the code does the newly created process start executing?
The forked process starts executing from the point where fork() is called.
Which properties best describe signals in QNX Neutrino?
Asynchronous, non-blocking
The ConnectAttach() function requires three identifiers as function parameters. What are those three (3) identifiers?
The node descriptor, the server's process ID, and the server's channel ID.
In QNX message passing, as soon as the client call its MsgSend(), it blocks and remains blocked until the server calls which function?
MsgReply()
In QNX message passing, if the server calls MsgReceive() before the client calls its MsgSend(), then in what state will the server process be in?
receive blocked
In Phase II of QNX message passing, how does the server know that the client sent a pulse?
The MsgReceive() function returns 0 (zero).
Recall Lab 3 - Process and Signals. In Part A of the lab, you registered a user-defined function, named handler(), to be the signal handler when the process receives a SIGUSR1 signal. The handler() function is defined as:
void handler() { usr1Happened = 1; }
What is the correct declaration of the usr1Happened variable in the 'C' programming language?
volatile sig_atomic_t usr1Happened;
Recall in "Lab 2 - Hello World" you created your first QNX Neutrino program. Assuming you uploaded the Hello World binary executable file to Neutrino, the call to getppid() will return the process ID of which process?
ksh
Which of these IPC methods blocks?
Message Passing
How are messages passed between processes on the same node passed?
The message is copied.
Which of the following terms below best describes the procedure of saving all registers of one process and then reloading all registers with the values for another process?
Context switch
Suppose you open a named semaphore:
sem_open( "/my_sem", O_CREAT, S_IWOTH, 0 );
What is the absolute path to the named semaphore on the QNX filesystem?
/dev/sem/my_sem
Which command lists the running processes on Neutrino?
pidin
Consider QNX message passing. Suppose you want the client to establish a connection to the server. Which function should you call?
ConnectAttach()
What is the default scheduling algorithm for newly created threads?
Round Robin
Recall in Lab4 - Thread Synchronization, the program thread-factory prompted the user for the number of threads to create. According to POSIX, which function should you immediately call after calling the pthread_create() function, and before creating the next thread?
pthread_attr_destroy()
In the context of scheduling algorithms for threads, the term resumption is best defined as?
When all threads of higher priority are finished with the CPU, the thread that was preempted is then given CPU time again.
Which of these are properties of QNX message passing (MsgSend(), MsgReceive() and MsgReply()?
Synchronous, blocking
Suppose one thread owns a mutex associated with a particular resource and two other threads are waiting for the same resource. Next, the thread which owns the mutex gives it up when finished with the resource. Which thread should get the mutex? Neutrino uses two criteria to decide. What are the two criteria, in-order of precedence?
priority level and length of wait
What is the normal scenario for process creation and termination?
The parent process waits until all the children terminate.
Which of the following is not a valid scheduling algorithm in QNX?
LIFO
Which of the following scheduling algorithms can cause a thread's priority to lower?
Sporadic
What is meant by pre-emption?
The CPU can be taken away from a thread with the intention of returning the thread back to the CPU at a later time.
Which of the following is not a form of IPC that is found on QNX?
Semaphores
Which scheduling algorithm allows a thread to run on the CPU for as long as it needs it?
FIFO
In Neutrino, there is a special thread called the "idle thread". What is the priority of the "idle thread"?
0
What is returned by the int ChannelCreate(...) function?
channel ID
Which type of diagram shows the set of states and transitions between states?
State transition diagram
In QNX message passing, if the client process calls MsgSend() before the server calls its MsgReceive(), then in what state will the client process be in?
send blocked
On QNX Neutrino, which command will run the program "myprog" in the background?
./myprog &
The QNX Neutrino RTOS supports many POSIX signals, including traditional UNIX signals. Of these signals, there are at least two signals that cannot be blocked nor be caught. For example, one of these signals is SIGKILL. Of the following signals, which signal cannot be blocked nor caught?
SIGSTOP
The QNX Neutrino RTOS is based on which type of architecture?
microkernel
In Phase II of QNX message passing the client calls which function to receive the reply message from the server?
MsgSend()
Which software application do you use to download and install the QNX Software Development (SDP) version 7.1 and other compatible products, add-ons, and BSPs?
QNX Software Center for your BYOD
Under which conditions would a counting semaphore block?
The semaphore value is zero
Context switching is fastest between?
a) threads are in the same process and threads are in the ready (to run) queue
Consider the Thread Scheduling Table below when answering the next five (5) questions. Each question is sequential. Meaning, the Thread Scheduling Table will change as operations complete from previous questions.
Which thread in the above table should be running (R)?
Priority: Ready: Blocked:
44 A(r), B(r)
43 C(r) D(f)
42 E(r)
A
After the first thread executes for one timeslice, which thread will get scheduled?
B
If threads A and B block, which thread will get scheduled?
C
Thread D unblocks. After one timeslice, which thread with get scheduled?
D
After one timeslice, which thread with get scheduled?
D
QNX Neutrino offers different forms of IPC. Which form is considered the faster?
Shared Memory
which of the following Neutrino commands will terminate a process named "looper" ?
/tmp $ ./looper
This process is in an infinite loop...
slay looper
Bad news .... man pages are not available from the Neutrino command line. Instead, you should use which command?
use
which function do you call to increment a semaphore?
sem_post()
Tapping "CTRL-C" together, at the same time, on your BYOD's keyboard results in which signal being sent?
SIGINT
Which of the following are valid actions for one-shot timers?
Pulse, signal, Create a new thread
When considering timers in QNX, the clock in QNX gives the number of seconds since which date?
The number of seconds since January 1, 1970
When a thread is created, it does not immediately execute, and it waits until it receives a signal to run
False
The Momentics IDE is based on which open-source IDE?
Eclipse
Which function returns the thread id (tid) of the current thread?
pthread_self()
A <blank> is composed of the following elements:
An address space
A program
The data
The required resources
Fill in the <blank>:
Thread
Shared Memory
Semaphore
Process
Channel
Process
Suppose you create a named semaphore by calling the sem_open() function. Which functionshould you call to destroy the semaphore?
sem_unlink()
Which function do you call to initialize the thread attributes?
pthread_attr_init()
What is the state of a child process if the parent process does not call wait()?
The child process becomes a zombie.
The shutdown CLI command shuts down and reboots QNX Neutrino. Which option shuts downNeutrino, but does not reboot?
-b
Can you install QNX Neutrino on a variety of hardware platforms?
True
Which function creates a named semaphore?
sem_open()
Which of these techniques would normally be used to allow a fixed number of threads (greater than two) to access a resource?
Semaphores
In QNX message passing, there is no requirement for the server to transfer any data back to the client. Which function would you call on the server to return no data back to the client?
MsgReply( rcvid, EOK, NULL, 0 );