CSCE3600 - Exam 2 Flashcards

1
Q

an independent stream of instructions that can be scheduled to be run by the OS

A

thread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a program with multiple streams

A

multithreading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

threads share…

A

memory and files with other threads that are in the same process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ownership of memory, files, and other resources

A

process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

makes shell

A

system()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

initiate new programs and replaces this process with a new one

A

exec()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

creates new process, start a concurrent process, creates a child process by making copy of parent

A

fork()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

two reasons for fork to fail

A

too many processes in the system

total number of processes exceeds system’s limit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

semaphores can be initialized to….

A

any value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

semaphores are used for

A

pthread blocking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

if semaphore value is less than or equal to zero…

A

threads are blocked

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

if semaphore value is greater than zero

A

blocked threads wake up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

when multiple processes use shard data and final outcome depends on order in which processes run

A

race conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

creates a thread

A

pthread_create

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

set thread to release

A

pthread_detach

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

test two thread IDs for equality

A

pthread_equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

exit a thread without exiting process

A

pthread_exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

send a signal to a thread

A

pthread_kill

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

wait for a thread

A

pthread_join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

find out own thread ID

A

pthread_self

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

allow threads to synchronize based upon the actual value of data

A

condition variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

explicit queue that threads can put themselves in when state of execution is not desired

A

waiting on a condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

another thread can wake up one/more waiting threads to allow them to continue

A

signaling on a condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

a per-process, unique, nonnegative integer used to identify an open file for the purpose of file access

A

file descriptors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

each file descriptor refers to exactly _____ open file descriptors but an open file description may be referred to by _____ than _____ file descriptor

A

one, more, one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

specification whether the file can be read and written

A

file access modes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

the byte position in the file where the next I/O operation through that open file description begins

A

file offset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

append mode or not blocking/non-blocking

A

file status includes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

creates a copy of the file descriptor oldfd

A

dup()

30
Q

makes newfd be the copy of oldfd closing newfd first if necessary

A

dup2()

31
Q

used only with related processes:
parent/child
child/child

A

unnamed pipes

32
Q

exists only as long as the processes using it are alive

A

unnamed pipes

33
Q

redirects input from a file

A
34
Q

redirects output to a new file

A

>

35
Q

redirects output and appends the data to a current file or creates if file doesn’t exist

A

> >

36
Q

both processes on same machine

A

UNIX domain

37
Q

processes on different machine

A

INET domain

38
Q

provides sequenced, reliable, two-way, connection-based byte streams (telnet, ssh, http)

A

SOCK_STREAM

39
Q

supports datagrams (connectionless, unreliable messages of a fixed maximum length

A

SOCK_DGRAM

40
Q

exec() returns _____ on error

A

-1

41
Q

socket&raquo_space; bind&raquo_space; listen&raquo_space; accept&raquo_space; close

A

steps in server process

42
Q

socket&raquo_space; set up sockaddr_un&raquo_space; connect&raquo_space; send and recv&raquo_space; close

A

steps in client process

43
Q

little-endian reads _________ first

A

high-order (first 8 bits)

44
Q

big-endian reads __________ first

A

low-order (last 8 bits)

45
Q

well-known ports, reserved by IANA

A

ports 0-1023

46
Q

registered ports

A

ports 1024-49151

47
Q

dynamic ports, OS use randomly

A

ports 49,152-65,535

48
Q

identifies a single host, variable length string (www.unt.edu)

A

hostname

49
Q

written as dotted octets, 32 bits

A

IP address

50
Q

identifies a process on a host, 16 bit number

A

port number

51
Q

socket()&raquo_space; sendto() (data request()&raquo_space; recvfrom()&raquo_space; close()

A

UDP Client flow

52
Q

socket()&raquo_space; bind()&raquo_space; recvfrom()&raquo_space; sendto()

A

UDP Server flow

53
Q

socket(int _______, int _______, int ________)

A

creates the socket,
domain (AF_UNIX, AF_INET)
type (SOCK_STREAM, SOCK_DGRAM, SOCK_RAW)
protocol (set to 0)

54
Q

bind(int ______, const struct _________ *_______, socklen_t _________)

A

bind the socket to an address in the UNIX domain
sockfd (returned by socket)
sockaddr *serveraddr
addrlen

55
Q

listen(int _______, int _________)

A

instruct the socket to listen for incoming connections
sockfd
backlog

56
Q

connect(int ______, const struct _________ *_______, socklen_t _________)

A

kernel will choose a dynamic port and source IP
sockfd (returned by socket)
sockaddr *serveraddr
addrlen

57
Q

send(int ___, const void *____, size_t ____, int _____)

recv(int ___, const void *____, size_t ____, int _____)

A

s (socket descriptor)
buf (buffer of information to send to an empty buffer)
len (size of the buffer in bytes
flags (0 or MSG_EOR, MSG_OOB)

58
Q

compiler optimization (4)

A

execution time, code size, memory usage, compile time

59
Q

optimized for code size

A

optimization flag -Os

60
Q

no optimisation, easy to debug but slower/larger

A

optimization flag -O0

61
Q

optimize for both speed and size

A

optimization flag -O1 or -O

62
Q

turn on most optimizations, enables instruction scheduling

A

optimization flag -O2

63
Q

turn on some extra performance, might increase code size, but increased performance

A

optimization flag -O3

64
Q

performs usually simple operations on the source files prior to compilation, sends output to stdout

A

preprocessor

65
Q

translates from one language to another, saves example.s

A

compiler

66
Q

assembles to relocatable object code, saves object

A

assembler

67
Q

combines object code and assembling source program, as well as libraries to make executable

A

linker

68
Q

gets an address to place program, changes necessary addresses, places code into memory

A

loader

69
Q

modifies binary, inserting probes at function entry/exit to collect data

A

instrumentation

70
Q

takes statistical samples of application performance

A

sampling