



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
These are the Lecture Slides of Program Optimization for Multi Core Architectures which includes Triangular Lower Limits, Multiple Loop Limits, Dependence System Solvers, Single Equation, Simple Test, Extreme Value Test etc.Key important points are: Communication Architectures, Layered Architecture, Agenda, Shared Address, Message Passing, Convergence, Generic Architecture
Typology: Slides
1 / 7
This page cannot be seen from the preview
Don't miss anything!
After assignment, deciding who is selected from among the pool of waiting processes Process dispatching. Single processor multiprogramming strategies may be counter-productive here. Priorities and process history may not be sufficient.
Single queue of processes or if multiple priority is used, multiple priority queues, all feeding into a common pool of processors. Multi-server queuing model: multiple-queue/single queue, multiple server system. Inference: Specific scheduling policy does not have much effect as the number of processors increase. Conclusion: Use FCFS with priority levels.
Produce(item_t item) { while (count==bufsz); buffer[in]=item; in=(in+1)%bufsz; count=count+1; }
Consume(item_t *item) { while(count==0); *item=buffer[out]; out=(out+1)%bufsz; count=count-1; } Shared Variables buffer, count
Variable count is shared. Both process read and modify this variable The assembly code for these two statement may be something like following:
//count=count+1 //count=count- P1: load R1,count C1: load R1,count P2: add R1,1 C2: sub R1, P3: store count,R1 C3: store count,R
Two processes run concurrently (Single or multiple CPUs)
The producer and consumer processes may be scheduled in any order and may be preempted. Consider the following sequence of statements P1, CSwitch , C1, C2, C3, CSwitch , P2, P3.
Situation when several concurrent processes operate on the same variable and the result of the computation depends upon the order in which they execut. In the preceding example, the value of count could be 4, 5 or 6. C1,P1,P2,P3,C2,C3 final value 4 C1,C2,C3,P1,P2,P3 final value 5 P1,C1,C2,C3,P2,P3 final value 6
We model the problem using the notion of Critical Sections. Critical sections are with respect to the shared data. There are n processes, each sharing some common resource. Each wants to modify the common resource. For each process, define the region of code where it accesses a shared piece of data as a critical section. In a correct system of multiple cooperating processes, Only one process must be inside its critical section.
Processes execute code similar to the following.
while (1) { Non critical code Entry code Critical Section Code Exit Code Non Critical Code }