DOC PREVIEW
TRINITY CSCI 1321 - Multithreading

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Multithreading9-12-2011Opening DiscussionMinute essay commentsMaps and Buffers in projects.Analysis is required for this project.MotivationThe future is parallel.Core counts are growing but clock speed isn't and neither is single thread performance.Software developers are behind the curve on this.Basic ApproachYou can use the java.lang.Thread class to represent a thread.Pass it a new Runnable that you define a run method in and call start to make it go.This makes it very easy to start new threads, but there are significant pitfalls when mutable memory is involved.joinThe join method of Thread will block until that thread has finished working.This is something you can do when you want a computation to continue only after each of the threads has completed.This only works if you are completely done with those threads.SynchronizationThreads use shared memory and you don't get significant control over what happens when.Race conditions are errors that occur because of dependence on timing details.Bank example.You can synchronize on objects to make sure critical blocks aren't accessed in parallelobj.synchronized { … }Slow and can cause deadlock.wait/notifyAllAllows synchronization between threads. A thread can wait and it won't restart until another thread notifies it.Put wait in while loop that checks boolean.Always use notifyAll instead of notify. Failure to do so leads to deadlocks.CodeI want to get commands working so that we can play with some of this in the drawing program.Minute EssayHow many cores does your computer have? Have you ever tried to keep them all busy?The next IcP is


View Full Document

TRINITY CSCI 1321 - Multithreading

Documents in this Course
Recursion

Recursion

11 pages

Iterators

Iterators

10 pages

Actors

Actors

9 pages

Recursion

Recursion

15 pages

Recursion

Recursion

10 pages

Threads

Threads

7 pages

Trees

Trees

11 pages

Load more
Download Multithreading
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Multithreading and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Multithreading 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?