Operating Systems (Threads) Flashcards

1
Q

Benefits of Single and Multi-treaded processes

A

1) Responsiveness
2) Resource sharing
3) Economy
4) Utilization of MP architectures

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

Parallel and concurrent systems, and modern CPUs

A

Parallel system - Performs more than one task simultaneously

Concurrent - Supports more than one task by allowing all tasks to make progress.

Modern CPUs support two or more threads per core

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

User threads are managed by thread libraries, like?

A

POSIX Pthreads, Win32 threads, and Java threads

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

Kernel Threads are supported and managed directly by?

A

The OS kernel

e.g.,
• Windows XP/2000
• Solaris
• Linux
• Tru64 UNIX
• Mac OS X
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Types of multi-threading models? (3)

A

1) Many-to-one
2) One-to-one
3) Many-to-many

Refers to the number of kernel threads : user threads

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

Examples of OS kernels classified by multi-threading model

A
  • Many-to-One
    • Solaris Green Threads
    • GNU Portable Threads
  • One-to-One
    • Windows NT/XP/2000
    • Linux
    • Solaris 9 and later

• Many-to-Many
• Solaris prior to version 9
• Windows NT/2000 with the ThreadFiber
package

 Two-level
     • IRIX
     • HP-UX
     • Tru64 UNIX
     • Solaris 8 and earlier
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Two-level multi-threading model?

A

1st level: Many-to-many

2nd level: one-to-one

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

Function of thread libraries

A

Provide programmer with an API for library in user space or a kernel library.

Java thread API generally
implemented using a thread library
available on the host system

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

Threading Issues (6)

A
  • fork() and exec() system calls
  • Thread cancellation
  • Signal handling
  • Thread pools
  • Thread specific data
  • Scheduler activations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Thread Pools

A
• Create a number of threads in a pool
where they await work
• Advantages:
• Slightly faster
• Can bound number of threads in app
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Signal Handling 1) Purpose, 2) Types, 3) Options

A

Signals are used in UNIX systems to notify a process
that a particular event has occurred
• Synchronous signal - delivered to process that
executed the event that caused the signal e.g.,
illegal memory access / division by 0
• Asynchronous signal - generated by an event
external to the running process
• Options:
• Deliver the signal to the thread to which the signal applies
• Deliver the signal to every thread in the process
• Deliver the signal to certain threads in the process
• Assign a specific thread to receive all signals for the process

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

Thread Cancellation 1) Meaning, 2) Types

A

Terminating a thread before it has finished
• Two general approaches:
• Asynchronous cancellation
• Deferred cancellation

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

Thread Specific Data: 1) What is it and why?

A

Each thread can have its own copy of
data, which is useful when you do not have control
over the thread creation process

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

Scheduler Activations and upcalls

A
• Both M:M and Two-level models
• require communication to maintain
the appropriate number of kernel
threads allocated to the application
• Scheduler activations provide upcalls
• a communication mechanism from
the kernel to the thread library
Examples: (Could just by multi-thread model)
• Pthreads
• Windows XP
• Linux
• Java
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Java Thread States

A

New, then can alternate between Runnable and Blocked (I/O sleep or I/O is available) , then Dead after termination.

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