Operating Systems & C Programming – Vocabulary Review

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/49

flashcard set

Earn XP

Description and Tags

Fifty vocabulary flashcards covering memory segments, process creation, file descriptors, pipes, sockets, threads, and related OS concepts

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

50 Terms

1
New cards

Text (Code) Segment

Memory area that stores machine instructions; usually read-only and fixed for the life of the program.

2
New cards

Data Segment

Section holding global and static variables that are explicitly initialized by the programmer before program start.

3
New cards

BSS Segment

Memory segment that contains uninitialized global and static variables; the loader zero-fills it at program start.

4
New cards

Stack Segment

LIFO region used for function call frames, local variables, parameters, and return addresses.

5
New cards

Heap

Dynamically managed memory area obtained with malloc/new and released with free/delete.

6
New cards

Uninitialized Global Variable

Global or static variable with no explicit initializer; stored in BSS and auto-initialized to zero.

7
New cards

Initialized Global Variable

Global or static variable that receives an explicit value at declaration; stored in the data segment.

8
New cards

Undefined Behavior (UB)

Result of executing code for which the C/C++ standard imposes no requirements, such as out-of-bounds access or null dereference.

9
New cards

File Descriptor (FD)

Integer handle that the kernel uses to identify an open file, pipe, socket, or device.

10
New cards

Standard Input (stdin)

Pre-opened file descriptor 0 used for program input, typically connected to keyboard or a pipe.

11
New cards

Standard Output (stdout)

Pre-opened file descriptor 1 used for normal program output, usually connected to terminal or a pipe.

12
New cards

Standard Error (stderr)

Pre-opened file descriptor 2 for error messages; separate from stdout so errors can be redirected independently.

13
New cards

freopen()

C library call that closes an existing FILE* stream and reopens it on a new file, enabling redirection of stdin, stdout, or stderr.

14
New cards

fork()

System call that creates a new process by duplicating the calling process; returns twice, once in parent, once in child.

15
New cards

Child Process PID Return Value

Value returned by fork() to the newly created child; always 0, allowing branch differentiation.

16
New cards

fork() Failure Return Value

Negative return (-1) from fork() indicating process creation failed; errno holds the error cause.

17
New cards

Process Count After fork()

Each successful fork doubles the number of running processes; n forks yield 2^n processes.

18
New cards

dup()

System call that duplicates an existing file descriptor to the lowest unused number, pointing to the same open file description.

19
New cards

dup2()

System call that duplicates oldfd onto a specified newfd, closing newfd first if necessary.

20
New cards

Pipe Read End

Index 0 of the int array returned by pipe(); used exclusively for reading data.

21
New cards

Pipe Write End

Index 1 of the int array returned by pipe(); used exclusively for writing data.

22
New cards

Named Pipe (FIFO)

Special file on the filesystem that provides pipe semantics between unrelated processes using a known pathname.

23
New cards

mkfifo()

Command/system call that creates a named pipe (FIFO) node in the filesystem.

24
New cards

execvp()

exec-family function that replaces the current process image with a new program, searching PATH for the executable and passing an argument vector.

25
New cards

socket() System Call

Creates an endpoint for network communication, returning a file descriptor representing a socket.

26
New cards

bind() System Call

Associates a socket with a local address (IP and port); required on the server side before listening.

27
New cards

listen() System Call

Marks a bound socket as passive, ready to accept incoming connection requests (TCP).

28
New cards

accept() System Call

Extracts the first pending connection on a listening socket and returns a new socket for data exchange.

29
New cards

connect() System Call

Initiates a connection from a client socket to a remote server address and port.

30
New cards

SOCK_STREAM

Socket type constant indicating a reliable, connection-oriented byte stream, typically TCP.

31
New cards

Loopback Address

IP address 127.0.0.1 used for network communication within the same host.

32
New cards

pthread_create()

POSIX thread API that spawns a new thread of execution, immediately starting the specified function.

33
New cards

pthread_join()

Blocks the calling thread until the specified thread terminates, optionally retrieving its exit status.

34
New cards

Header file that declares POSIX threading APIs such as pthreadcreate, pthreadmutex, and pthread_join.

35
New cards

-pthread Compile Flag

GCC/Clang option that links the pthread library and defines required macros for multithreading.

36
New cards

Critical Section

Code region that accesses shared resources and must execute by only one thread at a time to maintain consistency.

37
New cards

Mutex

Synchronization primitive (mutual exclusion lock) used to protect critical sections against concurrent access.

38
New cards

Copy-on-Write

Optimization where a child process shares physical pages with the parent after fork() until one modifies a page.

39
New cards

Heap vs Stack Isolation

Each process has its own private heap and stack; they are not shared between separate processes.

40
New cards

Preemptive Multitasking

OS scheduling model where the kernel can interrupt running tasks to allocate CPU time fairly among processes and threads.

41
New cards

Platform as a Service (PaaS)

Cloud computing model that delivers hardware and software tools over the internet to host, build, and deploy applications without managing infrastructure.

42
New cards

fork() Child Return Value Equals 0

Design detail enabling if-statements to distinguish child execution path using the zero value from fork().

43
New cards

Parent Return Value of fork()

Value returned to the parent process by fork(); it is the PID of the newly created child, never 0 on success.

44
New cards

Pipe Blocking Behavior

Unnamed pipes can cause open() or read()/write() calls to block until the opposite end is opened or has data.

45
New cards

Sockets vs Pipes IPC

Sockets support local and network communication, whereas unnamed pipes require parent-child relationship and share only local memory.

46
New cards

TCP vs UDP

TCP provides reliable, ordered delivery (SOCKSTREAM); UDP (SOCKDGRAM) offers connectionless, best-effort delivery.

47
New cards

LIFO Allocation

Stack memory management strategy where the last function called is the first to return, mirroring push/pop behavior.

48
New cards

Dynamic Memory Allocation

Runtime acquisition of memory from the heap using malloc/new, requiring explicit release with free/delete.

49
New cards

Global Variable Lifetime

Global and static variables in data or BSS segments exist for the entire lifetime of the program unless explicitly freed (heap allocation).

50
New cards

Number of Processes After n forks

General rule: executing n independent fork() calls results in 2 raised to the power of n separate processes.