CSCI 1730 FINAL (LAMARCA) FINAL
EXAM QUESTIONS AND ANSWERS
GRADED A+ 2026
What is concurrency? State some different examples of concurrency in systems programming. -
ANS concurrency - when two or more3 things are executing at the same time. Examples of
concurrency - bash, operating system, emacs, user programs, signals, pipes, File I/O, and
sockets.
How does a C programmer write a single program that can exhibit concurrent behavior? What
system calls are involved in creating a process that exhibit concurrent behavior? - ANS the
user can call fork or use a pthread in a single program. System calls: fork() and pthread()
What is IPC? How does IPC relate to systems programming and concurrency? - ANS IPC -
inter-process communication. It allows the programmer to coordinate activities among various
program processes which can run concurrently in a OS
What system calls are used in network IPC and concurrency? - ANS system calls: socket(),
bind(), listen(), accept(), connect(), send(), recv(), close()
What is a thread? Why is a thread also called a lightweight process? - ANS A thread is a way
for a program to divide into itself into two or more simultaneously running tasks. Sometimes
called lightweight processes because they have their own stack but can access shared data.
@COPYRIGHT 2026/2027 ALL RIGHTS RESERVED
1
,what is the difference between a multi-threaded process and a process that forks into a child
and parent process? - ANS Threading runs multiple line of execution intraprocesses. Forking
is a means of creating new processes.
What system calls are associated with pthreads? - ANS system calls: pthread_self(),
pthread_equal(), pthread_create(), pthread_exit(), pthread_join(),
what is a signal handler and when are they used? - ANS signal handler - a function which is
called when the target environment when the corresponding signal occurs
what system calls are associated with sockets? - ANS system calls:
what is an active participant? - ANS client
what is a passive participant? - ANS server
What system calls does a passive participant typically call that an active participant may not
typically call. - ANS listen() and accept()
Do concurrent processes need to be run on the same machine? - ANS no
Suppose computer A is running process B and computer C is running process D. also suppose A
and C are different computers running different hardware and B & C are running concurrently.
Can IPC be established between be and D. So then, what system calls are typically involves in
the IPC between B and C? If not, explain why B and C cannot establish IPC? - ANS
what system calls are used to handle the IPC between the two processes in the command below
? ls | grep *.c - ANS
what is section 1 of the manual pages on odin used for? - ANS Applications
@COPYRIGHT 2026/2027 ALL RIGHTS RESERVED
2
, what is section 2 of the manual pages on odin used for? - ANS system calls
what is section 3 of the manual pages on odin used for? - ANS library functions
When reading a manual page on odin, how do you know what section you are in? - ANS
what is the difference between a library function call and a system function call? -
ANS system call - a call made by the program to enter into kernel mode to access a process
function call - made by the program to access a library function defined in a programming
library
what are the functions htonl(...) and ntohl(...) used for? Why are they typically used? -
ANS htonl() - takes a 32-bit number in host byte order and returns a 32-bit number in the
network byte order
ntohl()- converts the unsigned integer netlong from network byte order to host byte order.
used in TCP/IP networks, do nothing on big-endian, on little-endin they reverse the byte order,
used for machines to communicate with each other over the network
In C++, what is the difference between pass by value and pass by reference? - ANS pass by
value only passes a copy of a variable. meanwhile pass by refernce actually passes the variable
allowing it to be changed.
Does C have pass by reference? if not, how do we use pass by value to simulate pass by
reference behavior in C? - ANS No. You can use dereferenced pointers as arguments in the
function definition. Also use the 'address of' (&) operator on the variables when calling the
functions
What different kinds of constructors and destructors are there in C++? What are their purposes?
Explain why C doesn't have constructors and destructors. Explain why Java classes typically
@COPYRIGHT 2026/2027 ALL RIGHTS RESERVED
3
EXAM QUESTIONS AND ANSWERS
GRADED A+ 2026
What is concurrency? State some different examples of concurrency in systems programming. -
ANS concurrency - when two or more3 things are executing at the same time. Examples of
concurrency - bash, operating system, emacs, user programs, signals, pipes, File I/O, and
sockets.
How does a C programmer write a single program that can exhibit concurrent behavior? What
system calls are involved in creating a process that exhibit concurrent behavior? - ANS the
user can call fork or use a pthread in a single program. System calls: fork() and pthread()
What is IPC? How does IPC relate to systems programming and concurrency? - ANS IPC -
inter-process communication. It allows the programmer to coordinate activities among various
program processes which can run concurrently in a OS
What system calls are used in network IPC and concurrency? - ANS system calls: socket(),
bind(), listen(), accept(), connect(), send(), recv(), close()
What is a thread? Why is a thread also called a lightweight process? - ANS A thread is a way
for a program to divide into itself into two or more simultaneously running tasks. Sometimes
called lightweight processes because they have their own stack but can access shared data.
@COPYRIGHT 2026/2027 ALL RIGHTS RESERVED
1
,what is the difference between a multi-threaded process and a process that forks into a child
and parent process? - ANS Threading runs multiple line of execution intraprocesses. Forking
is a means of creating new processes.
What system calls are associated with pthreads? - ANS system calls: pthread_self(),
pthread_equal(), pthread_create(), pthread_exit(), pthread_join(),
what is a signal handler and when are they used? - ANS signal handler - a function which is
called when the target environment when the corresponding signal occurs
what system calls are associated with sockets? - ANS system calls:
what is an active participant? - ANS client
what is a passive participant? - ANS server
What system calls does a passive participant typically call that an active participant may not
typically call. - ANS listen() and accept()
Do concurrent processes need to be run on the same machine? - ANS no
Suppose computer A is running process B and computer C is running process D. also suppose A
and C are different computers running different hardware and B & C are running concurrently.
Can IPC be established between be and D. So then, what system calls are typically involves in
the IPC between B and C? If not, explain why B and C cannot establish IPC? - ANS
what system calls are used to handle the IPC between the two processes in the command below
? ls | grep *.c - ANS
what is section 1 of the manual pages on odin used for? - ANS Applications
@COPYRIGHT 2026/2027 ALL RIGHTS RESERVED
2
, what is section 2 of the manual pages on odin used for? - ANS system calls
what is section 3 of the manual pages on odin used for? - ANS library functions
When reading a manual page on odin, how do you know what section you are in? - ANS
what is the difference between a library function call and a system function call? -
ANS system call - a call made by the program to enter into kernel mode to access a process
function call - made by the program to access a library function defined in a programming
library
what are the functions htonl(...) and ntohl(...) used for? Why are they typically used? -
ANS htonl() - takes a 32-bit number in host byte order and returns a 32-bit number in the
network byte order
ntohl()- converts the unsigned integer netlong from network byte order to host byte order.
used in TCP/IP networks, do nothing on big-endian, on little-endin they reverse the byte order,
used for machines to communicate with each other over the network
In C++, what is the difference between pass by value and pass by reference? - ANS pass by
value only passes a copy of a variable. meanwhile pass by refernce actually passes the variable
allowing it to be changed.
Does C have pass by reference? if not, how do we use pass by value to simulate pass by
reference behavior in C? - ANS No. You can use dereferenced pointers as arguments in the
function definition. Also use the 'address of' (&) operator on the variables when calling the
functions
What different kinds of constructors and destructors are there in C++? What are their purposes?
Explain why C doesn't have constructors and destructors. Explain why Java classes typically
@COPYRIGHT 2026/2027 ALL RIGHTS RESERVED
3