Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,487 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,107 people online right now. Registration is fast and FREE... Join Now!




Jacobi Parallel

 
Reply to this topicStart new topic

Jacobi Parallel, using threads

chuck87
post 4 Jun, 2008 - 08:33 AM
Post #1


D.I.C Head

**
Joined: 7 Sep, 2007
Posts: 65


My Contributions


My assignment is the heat distribution in a room that will be calculated with the Jacobi algorithm

1)As shown in the picture attached i have to use threads.If my array is 400x400 I will use 199 threads.
Should I use so many threads??

2) I know that the execution of some threads must be blocked by other threads.When should these blocks happen?


Well my second question is my greatest concern so if anyone could give me a hint I will be really grateful

Attached File  parallel.bmp ( 487.9k ) Number of downloads: 32
User is offlineProfile CardPM

Go to the top of the page

1lacca
post 4 Jun, 2008 - 08:50 AM
Post #2


code.rascal

Group Icon
Joined: 11 Aug, 2005
Posts: 3,822



Thanked 11 times
My Contributions


It depends how many threads your system can process at once.
If it can run 199, then it is fine.
Otherwise, there are two possibilities:
- they are prioritized in a way, so they run after each other without much switching. this way it is only a waste of space for the administration of threads
- they all try to run at once, and a lot of switching is going on: this will trash performance as well, because of the overhead that comes with the switching
Bottom line: usually it is not worth creating much more threads than your system can run at once.

Regarding the second question: blocks usually happen at two points:
- when a thread is waiting for the result of another
- when several threads use the same resource (memory, device, whatever), so they are waiting for the other to finish
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 04:14PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month