Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exam 2 csce 3600 questions well answered graded A+, Exams of Nursing

Exam 2 csce 3600 questions well answered graded A+-

Typology: Exams

2024/2025

Available from 03/25/2025

studyclass
studyclass 🇺🇸

4.6K documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Exam 2 csce 3600 questions well
answered graded A+
The SELECT function allows the servers to deal with blocking calls by identifying sockets that are
ready for use - correct answer ✔✔True
In a single processor system, all the threads execute in interleaved fashion(=though in no
particular order) sharing the CPU - correct answer ✔✔True
System calls or library routines are called thread safe if they can be called from multiple threads
simultaneously and always produce correct results - correct answer ✔✔True
Each process has its own ready queue - correct answer ✔✔False
Datagram sockets do not require the client to establish a connection with the server before
sending messages to the server - correct answer ✔✔False
preemptive scheduling algorithms may results in starvation - correct answer ✔✔True
The degree of multi program is controller by the CPU scheduler - correct answer ✔✔False
When the PTHREAD_EXIT system call is issued by a thread, all threads associated with that
process are terminated - correct answer ✔✔False
A child process created by the FORK system call inherits its parent's process id - correct answer
✔✔False
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Exam 2 csce 3600 questions well answered graded A+ and more Exams Nursing in PDF only on Docsity!

Exam 2 csce 3600 questions well

answered graded A+

The SELECT function allows the servers to deal with blocking calls by identifying sockets that are ready for use - correct answer ✔✔True In a single processor system, all the threads execute in interleaved fashion(=though in no particular order) sharing the CPU - correct answer ✔✔True System calls or library routines are called thread safe if they can be called from multiple threads simultaneously and always produce correct results - correct answer ✔✔True Each process has its own ready queue - correct answer ✔✔False Datagram sockets do not require the client to establish a connection with the server before sending messages to the server - correct answer ✔✔False preemptive scheduling algorithms may results in starvation - correct answer ✔✔True The degree of multi program is controller by the CPU scheduler - correct answer ✔✔False When the PTHREAD_EXIT system call is issued by a thread, all threads associated with that process are terminated - correct answer ✔✔False A child process created by the FORK system call inherits its parent's process id - correct answer ✔✔False

condition variable allows a thread to block itself until specified data reaches a redefined state - correct answer ✔✔True A thread will block if the semaphore value is less than or equal to zero when a SEM_WAIT is issued - correct answer ✔✔True As the time slice becomes shorter, the more the RR scheduler behaves like the FIFO scheduler - correct answer ✔✔False The privilege mode must be changed to "kernel mode" when doing a system call - correct answer ✔✔True One of the guarantees offered by the PIPE IPC system call is that__________ - correct answer ✔✔All writes up to 4K bytes to the pipe are atomic turnaround time refers to the amount of time___________ - correct answer ✔✔Needed to executes a particular process _______ refers to a situation in which a process is ready to execute, but is continuously denied access to a processor in deference to other processes - correct answer ✔✔Starvation Consider the following code Int main() { If (fork() > 0)

Which of the following are virtually shared by threads within a single process? In other words, which are instantiated per process instead of per thread? - correct answer ✔✔Code / program text Which of the following is true of multilevel queue scheduling - correct answer ✔✔Each queue has its own scheduling algorithm. A process control block ______ - correct answer ✔✔includes information on the process's state In scheduling algorithms, the term "aging" involved _______ - correct answer ✔✔gradually increasing the priority of a process so thar the process will eventually execute Which scheduling algorithm suffers from the convoy effect - correct answer ✔✔FIFO

  1. consider the following program int main() { struct sockaddr_un svr; int fd_svr = socket(AF_UNIX, SOCK_STREAM, 0); svr.sun_family = AF_UNIX; strcpy(svr.sun_path, "svr_sock"); bind(fd_svr, (struct sockaddr*)&svr, sizeof(svr)); listen(fd_svr, 3); return 0;

What is the length of the queue for pending connections ( i.e partially completed connections) in this program - correct answer ✔✔ 3 ______are all valid process states - correct answer ✔✔running, blocked and waiting What will be the output of the following code? #include <sys/types.h> #include <stdio.h> int main() { pid_t pid = fork(); if (pid>0) printf("parent"); else printf("child"); return 0; } - correct answer ✔✔can be childparent or parentchild

consider the following set of processes arriving at the same time with their respective CPU burst time (in milliseconds): process CPU-Burse Time P1 12 P2 3 P3 6 if the processes are scheduled round robin (RR) in the order P1, P2, then P3, which of the following time slice lengths would give the best average waiting time - correct answer ✔✔3 ms in Linux, which system call causes the parent parent process to suspend execution until the child process has completed? - correct answer ✔✔wait a parser will check to see that input is semantically correct - correct answer ✔✔false Child processes, which are exact copies if their parents, can change variables in its parent process - correct answer ✔✔False a new process ID is created when the EXEC() function is called - correct answer ✔✔false the following regular expressions are exactly equivalent: y|z (y|z)* - correct answer ✔✔false

two UNIX/LINUX processes may simultaneously have open file descriptors that refer to the same open file description - correct answer ✔✔true INET domain sockets can only send messages to a different machine - correct answer ✔✔false the following regular expressions are exactly equivalent: (0|1)? 0?|1? - correct answer ✔✔true the UNIX/LINUX operating system allows multiple processes per thread - correct answer ✔✔false a function is said to be thread-safe if it can be called from multiple thread without unwanted interaction between the threads - correct answer ✔✔true for a given mutex, if one or more threads are blocked on a call to PTHREAD_MUTEX_LOCK() and the thread that is holding the lock calls PTHREAD_MUTEX_UNLOCK(), exactly one of the blocked threads will be unlocked and thus able to lock the mutex - correct answer ✔✔true ______ is a Pthreads function that terminates the calling thread ans makes the value value_ptr available to any successful join with the terminating thread - correct answer ✔✔pthread_exit Consider concurrent programming via "threads". For which of the following information would each thread get its own unique copy? - correct answer ✔✔stack an application that allows two different machines to communicate using a socket requires _____________ - correct answer ✔✔one of the machines to implement a server socket and the other a client socket

which system call creates a copy of the file descriptor passes as an argument? - correct answer ✔✔dup SOCK_STREAM sockets are used by ______ processes. - correct answer ✔✔TCP Consider the following program int main() { char * cmd[4]; cmd[0] = "ls"; cmd[1] = NULL; int fd = open ("testfile", o_creat | o_trunc | o_wronly, 0600); dup2(? ,? ); execvp(cmd[0], cmd); perror("main"); } how would you fill in question if you want the output of "ls" to go into "testfile"? - correct answer ✔✔dup2(fd,1) the pthread_cond_signal() call is used to_________ - correct answer ✔✔wake up a sleeping thread waiting on the condition variable

consider the following snippet of code in a program pip=fork(); if (pid == 0) { ...... Assuming the fork system call us successful, what is purpose of the "if (pid == 0)" line? - correct answer ✔✔it checkes whether the process is the child or the parent process after the call to fork the ________ contains all the states necessary to run a program, such as the stack, text segment, data section, and heap - correct answer ✔✔user level context Three file descriptors associated with every UNIX/LINUX process are standard input, standard output, and _________________ - correct answer ✔✔standard error Which of the following is True regarding the relationship between processes and threads - correct answer ✔✔it takes far less time to create a new thread in an existing process than to create a new process Compiler optimization entails all of the following except _______ - correct answer ✔✔suppressing error messages