CSCE3600 - Exam 2 Flashcards
an independent stream of instructions that can be scheduled to be run by the OS
thread
a program with multiple streams
multithreading
threads share…
memory and files with other threads that are in the same process
ownership of memory, files, and other resources
process
makes shell
system()
initiate new programs and replaces this process with a new one
exec()
creates new process, start a concurrent process, creates a child process by making copy of parent
fork()
two reasons for fork to fail
too many processes in the system
total number of processes exceeds system’s limit
semaphores can be initialized to….
any value
semaphores are used for
pthread blocking
if semaphore value is less than or equal to zero…
threads are blocked
if semaphore value is greater than zero
blocked threads wake up
when multiple processes use shard data and final outcome depends on order in which processes run
race conditions
creates a thread
pthread_create
set thread to release
pthread_detach
test two thread IDs for equality
pthread_equal
exit a thread without exiting process
pthread_exit
send a signal to a thread
pthread_kill
wait for a thread
pthread_join
find out own thread ID
pthread_self
allow threads to synchronize based upon the actual value of data
condition variables
explicit queue that threads can put themselves in when state of execution is not desired
waiting on a condition
another thread can wake up one/more waiting threads to allow them to continue
signaling on a condition
a per-process, unique, nonnegative integer used to identify an open file for the purpose of file access
file descriptors
each file descriptor refers to exactly _____ open file descriptors but an open file description may be referred to by _____ than _____ file descriptor
one, more, one
specification whether the file can be read and written
file access modes
the byte position in the file where the next I/O operation through that open file description begins
file offset
append mode or not blocking/non-blocking
file status includes