adp concurrency new

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

1/8

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

Do concurrency threads interact with each other?

They may interact with each other however they have an implied relationship between them

2
New cards

Why are threads preferred over processes for concurrency?

Because threads share the same memory space, making it easier to access shared variables

3
New cards

What does the synchronized keyword prevent in concurrency

It helps prevent race conditions and memory inconsistency errors by ensuring mutual exclusion

4
New cards

Thread A holds Resource 1 and waits for Resource 2, while Thread B holds Resource 2 and waits for Resource 1 - What is this deadlock example called?

Circular wait

5
New cards

How can race conditions cause data corruption?

If multiple threads modify the same resource at a time values can get overwritten

6
New cards

How can race conditions lead to system instability?

Can cause a program to crash or behave unpredictably

7
New cards

How do you prevent memory consistency errors?

By using the synchronised keyword or marking shared variables as volatile

8
New cards

How does the OS schedule threads?

It schedules threads independently causing some to operate on outdated data

9
New cards

What is mutual exclusion?

When one thread can only access a shared resource at a time