SlideShare une entreprise Scribd logo
1  sur  19
CHALLENGES IN
MULTI-CORE
PROGRAMMING
-by Ms. Nishigandha Wankhade
Outline






Sequential Model
Concurrency
Challenges of concurrency
New Libraries for C++ Developers
Processor Architecture Challenges

Challenges in Multi-core Programming

2/27/2014

2
SEQUENTIAL MODELS
 A model in which instructions are executed one at a time.
 Computer perform each step in specific order.
 Program is divided into multiple tasks.
 Computer programs set up in story form Beginning , Middle and End
 All the tasks in program are in one file.
 All tasks are interdependent.
 Ex: Let A, B, C and D are four tasks. Then B starts only after
completing task A. Then after finishing the task B the C
starts and so on….

Challenges in Multi-core Programming

2/27/2014

3
CONCURRENCY
 Two tasks are said to be concurrent if they occur within the
same time interval.
 They do not mean that the tasks are executing at the same
instance.
 They might be executing at the same hour but at different
period of interval.
 EX: A and B are two concurrent tasks means- A might execute
for some fraction of seconds then B might execute for some
fraction of seconds. Again the task A execute, so on.......
 Concurrent tasks can execute in
MULTIPROCESSING ENVIRONMENT.

Challenges in Multi-core Programming

a SINGLE

2/27/2014

or

4
CONCURRENCY
 Single Processing Environment:
 Context Switching :
 It is a process of storing and restoring the execution state so
that multiple processes can share the same processor in a given
period of time.

 Multiprocessing Environment:
 Depends on No. of FREE Processors.
 Developer deals with following challenges:
 1. Software Development
 2. Software Deployment
 3. Software maintenance

Challenges in Multi-core Programming

2/27/2014

5
SOFTWARE DEVELOPMENT
 It happens from developing device drivers to large scale Ntire applications.
 Its size and scope vary to large extent. So, challenges are in
creating multiprocessing and multithreading applications.
 Carried out in various phases [ SDLC].

Challenges in Multi-core Programming

2/27/2014

6
SOFTWARE DEVELOPMENT
 SDLC ACTIVITIES

DESCRIPTION

Requirement
specification

Agreement between developer and the client. What s/w
must do and Constrains are specified.

Design

Specifications are model using s/w design. It determines
the INTERNAL STRUCTURE.
2 approaches- architectural design and detailed design.

Implementation

Detailed design is translated to the programming code.

Testing and
Evaluation

Exercising s/w in order to uncover the errors and improve
the quality of s/w.

Maintenance

After delivery of s/w.
Modifications are done to correct errors, to improve
performance.

Challenges in Multi-core Programming

2/27/2014

7
SOFTWARE DEVELOPMENT METHODOLOGY
S/W
DEVELOPMENT
METHODOLOGIES

DESCRIPTION

CORE ACTIVITIES

Agile

Part of functionality is delivered
at some time interval

Planning, requirement analysis,
design, implementation,
testing and documentation

Build and Fix

s/w is build and modifications
are done many times as needed

Build initial version, modify as
per customer’s requirements,

At each iteration developer
inform the client about time
required. Client selects the
desire feature

Requirement gathering,
specification, architectural
design, implementation and
integration, delivery

s/w developed in increments.
Integrated module by module

Requirement gathering,
specification, architectural
design, build loop



Extreme
Programming

Incremental

Challenges in Multi-core Programming

2/27/2014

8
SOFTWARE DEVELOPMENT METHODOLOGY
S/W
DEVELOPMENT
METHODOLOGIES



Object Oriented

DESCRIPTION

Objects are identified and with
them s/w is designed

At each iteration prototype of the
Rapid prototyping system is developed.
Interaction with client.

Spiral

Structured

Waterfall

CORE ACTIVITIES

Requirement gathering, OO
analysis, OO design,
implementation and integration
Rapid prototyping, specifications,
design, implementation,
integration, maintenance,
retirement.

Iterative model like incremental.
Emphasis on risk analysis and
verification at each phase

Planning, risk analysis,
evaluation

Top down approach.

Requirement analysis, design,
Implementation, testing,
development.

c/as linear sequential model

Rrq. Gathering and specification,
design, imple, integration,
9
maintenance, retirement
2/27/2014

Challenges in Multi-core Programming
CHALLENGES OF S/W DEVELOPMENT
 1) S/W Decomposition:
-> WBS & Architectural Artifacts (AAs)
-> Decomposition is written in form of PROBLEM & SOLUTION
CHALLENGES OF S/W DECOMPOSITION:

1) multiple ways to rep[resent a problem and its solution
2) making sure that decomposition is complete and correct.

-> Finding right model for decomposition.

Challenges in Multi-core Programming

2/27/2014

10
CHALLENGES OF S/W DEVELOPMENT
 2) Task To Task Communication:
-> IPC ?
-> Managing IPC:
POSIX support six basic mechanisms to
accomplish communication between processes.
1) Files with lock and unlock facility
2) Pipes
3) Shared Memory
4) Message Queues
5) Semaphore (use variables)
6) Sockets
Challenges in Multi-core Programming

2/27/2014

11
CHALLENGES OF S/W DEVELOPMENT
 3) Concurrent Access To Data Or Resources By
Multiple Tasks Or Agents:
Three commonly occurring problems while executing the instructions
concurrently:->

1) Data race: When two or more tasks are attempting to update the

data resource at the same time, the race condition occurs which is called
as data race.

2) Deadlock: It is a situation in which two or more tasks are waiting

for the other to finish so that they can acquire the resources.

3) Indefinite postponement: In this one or more tasks are waiting

for some event or condition to occur and if that condition or event never
occurs.
Challenges in Multi-core Programming

2/27/2014

12
CHALLENGES OF S/W DEVELOPMENT
 4) Identifying Relationship Between Concurrently
Executing Tasks:

Four basic relationships
1) Start to Start
2) Finish to Start
3) Start to Finish
4) Finish to Finish

5) Controlling resource contention between tasks
6) Determining sufficient no. of processes or threads

Challenges in Multi-core Programming

2/27/2014

13
CHALLENGES OF S/W DEVELOPMENT
 7 & 8) Finding reliable and reproducible debugging and
testing
-> Testing & debugging in sequential model.
-> Difficult to produce exact content of parallel or concurrent tasks
because of OS-scheduling policies,
dynamic workload,
process or thread priorities etc.
-> Multiprocessing and multithreaded applications are nondeterministic in nature.
That is recreation of the same sequence of events of these
type of applications in order to test or debug the program is
NOT POSSIBLE AT ALL.
-> Finding the right debugger or profiler
* state of the kernel process and system calls.

* attach or detach a process or thread.
14
CHALLENGES OF S/W DEVELOPMENT
9) Communicating the designs having multiprocessing
components.
-> UML (Unified Modeling Language)
-> System Architecture (Structural Diagrams):
1) Component diagram: Represent the dependencies
and organization among a set of physical modules.

2) Deployment diagram: shows runtime

configuration of processing nodes, hardware and
software components in a system.

-> Behavioral Diagrams:
1) State diagram
2) Sequence diagram
3) Activity diagram
4) Collaboration diagram
15
CHALLENGES OF S/W DEVELOPMENT
10) Implementing multiprocessing and multithreading in
C++.
-> C++ does not include any keyword primitives for
parallelism.
-> How can we implement the multiprocessing or
multithreading applications using C++? (By using libraries)

Challenges in Multi-core Programming

2/27/2014

16
NEW LIBRARIES FOR C++ DEVELOPERS
1) System Libraries:
-> Provides by O.S. itself
-> Ex: POSIX thread Library.
It contains the set of system calls that support parallelism.

-> POSIX ( Portable O. S. Interface for Unix)
* POSIX threads
* POSIX spawn function
* The exec() family of functions

2/27/2014

17
PROCESSOR ARCHITECTURE CHALLENGES
Four popularly used multi-core architectures1) Opteron
2) Cell
3) UltraSparc T1
4) Intel Core-2
-> These different architectures translate to different sets of compiler
switches and directives.
-> For this, it is necessary that the developer must be familiar with the use of
compiler and linker specific features.
-> In some cases multiple types of compilers needed to generate single
executable program.
-> But for taking the advantage of particular architecture we can make the
s/w non-portable.
-> So, taking most advantage of Multicore architecture without affecting
the portability of the s/w application is the real challenge of processor
architecture.
2/27/2014

18
REFERENCE
 1)

“Professional Multicore Programming: Design and
Implementation for C++ Developers “, Wiley India

Edition, ISBN: 978-81-265-1875-3.

19

Contenu connexe

Tendances

3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies
op205
 
Software Design
Software DesignSoftware Design
Software Design
Ha Ninh
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
Philip Johnson
 
Java vs .net
Java vs .netJava vs .net
Java vs .net
Tech_MX
 

Tendances (20)

Linux and Java - Understanding and Troubleshooting
Linux and Java - Understanding and TroubleshootingLinux and Java - Understanding and Troubleshooting
Linux and Java - Understanding and Troubleshooting
 
10.1.1.65.2852
10.1.1.65.285210.1.1.65.2852
10.1.1.65.2852
 
UML Case Tools
UML Case ToolsUML Case Tools
UML Case Tools
 
Java programming language
Java programming languageJava programming language
Java programming language
 
java
javajava
java
 
3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies
 
Arch java
Arch javaArch java
Arch java
 
Project MPS
Project MPSProject MPS
Project MPS
 
4.129 tybsc it
4.129 tybsc it4.129 tybsc it
4.129 tybsc it
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
 
F5 learning-area-5-programming
F5 learning-area-5-programmingF5 learning-area-5-programming
F5 learning-area-5-programming
 
Software Architecture - All you need to know
Software Architecture - All you need to knowSoftware Architecture - All you need to know
Software Architecture - All you need to know
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual Machine
 
COMPILER Meenu khan
COMPILER Meenu khanCOMPILER Meenu khan
COMPILER Meenu khan
 
COMPILER
COMPILERCOMPILER
COMPILER
 
Distributed Application Development (Introduction)
Distributed Application Development (Introduction)Distributed Application Development (Introduction)
Distributed Application Development (Introduction)
 
Software Design
Software DesignSoftware Design
Software Design
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
 
Programming and problem solving with c++, 3rd edition
Programming and problem solving with c++, 3rd editionProgramming and problem solving with c++, 3rd edition
Programming and problem solving with c++, 3rd edition
 
Java vs .net
Java vs .netJava vs .net
Java vs .net
 

Similaire à Challenges in multi core programming by Nishigandha Wankhade

Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
the_wumberlog
 
School management system
School management systemSchool management system
School management system
Soumya Behera
 
Essence of waterfall_model
Essence of waterfall_modelEssence of waterfall_model
Essence of waterfall_model
wanda31
 

Similaire à Challenges in multi core programming by Nishigandha Wankhade (20)

Devops : Automate Your Infrastructure with Puppet
Devops : Automate Your Infrastructure with PuppetDevops : Automate Your Infrastructure with Puppet
Devops : Automate Your Infrastructure with Puppet
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
Day1
Day1Day1
Day1
 
Enhance your Agility with DevOps
Enhance your Agility with DevOpsEnhance your Agility with DevOps
Enhance your Agility with DevOps
 
Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 
Se chapter 1,2,3 2 mark qa
Se chapter 1,2,3   2 mark  qaSe chapter 1,2,3   2 mark  qa
Se chapter 1,2,3 2 mark qa
 
Application cloudification with liberty and urban code deploy - UCD
Application cloudification with liberty and urban code deploy - UCDApplication cloudification with liberty and urban code deploy - UCD
Application cloudification with liberty and urban code deploy - UCD
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
 
Documentation
DocumentationDocumentation
Documentation
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
 
Continuous Integration With Jenkins
Continuous Integration With JenkinsContinuous Integration With Jenkins
Continuous Integration With Jenkins
 
School management system
School management systemSchool management system
School management system
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Embedded multiple choice questions
Embedded multiple choice questionsEmbedded multiple choice questions
Embedded multiple choice questions
 
CI/CD Pipeline with Docker
CI/CD Pipeline with DockerCI/CD Pipeline with Docker
CI/CD Pipeline with Docker
 
IRJET - Code Compiler Shell
IRJET -  	  Code Compiler ShellIRJET -  	  Code Compiler Shell
IRJET - Code Compiler Shell
 
Resume
ResumeResume
Resume
 
Software design
Software designSoftware design
Software design
 
Essence of waterfall_model
Essence of waterfall_modelEssence of waterfall_model
Essence of waterfall_model
 
Serverless Summit - Quiz
Serverless Summit - QuizServerless Summit - Quiz
Serverless Summit - Quiz
 

Dernier

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Dernier (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 

Challenges in multi core programming by Nishigandha Wankhade

  • 2. Outline      Sequential Model Concurrency Challenges of concurrency New Libraries for C++ Developers Processor Architecture Challenges Challenges in Multi-core Programming 2/27/2014 2
  • 3. SEQUENTIAL MODELS  A model in which instructions are executed one at a time.  Computer perform each step in specific order.  Program is divided into multiple tasks.  Computer programs set up in story form Beginning , Middle and End  All the tasks in program are in one file.  All tasks are interdependent.  Ex: Let A, B, C and D are four tasks. Then B starts only after completing task A. Then after finishing the task B the C starts and so on…. Challenges in Multi-core Programming 2/27/2014 3
  • 4. CONCURRENCY  Two tasks are said to be concurrent if they occur within the same time interval.  They do not mean that the tasks are executing at the same instance.  They might be executing at the same hour but at different period of interval.  EX: A and B are two concurrent tasks means- A might execute for some fraction of seconds then B might execute for some fraction of seconds. Again the task A execute, so on.......  Concurrent tasks can execute in MULTIPROCESSING ENVIRONMENT. Challenges in Multi-core Programming a SINGLE 2/27/2014 or 4
  • 5. CONCURRENCY  Single Processing Environment:  Context Switching :  It is a process of storing and restoring the execution state so that multiple processes can share the same processor in a given period of time.  Multiprocessing Environment:  Depends on No. of FREE Processors.  Developer deals with following challenges:  1. Software Development  2. Software Deployment  3. Software maintenance Challenges in Multi-core Programming 2/27/2014 5
  • 6. SOFTWARE DEVELOPMENT  It happens from developing device drivers to large scale Ntire applications.  Its size and scope vary to large extent. So, challenges are in creating multiprocessing and multithreading applications.  Carried out in various phases [ SDLC]. Challenges in Multi-core Programming 2/27/2014 6
  • 7. SOFTWARE DEVELOPMENT  SDLC ACTIVITIES DESCRIPTION Requirement specification Agreement between developer and the client. What s/w must do and Constrains are specified. Design Specifications are model using s/w design. It determines the INTERNAL STRUCTURE. 2 approaches- architectural design and detailed design. Implementation Detailed design is translated to the programming code. Testing and Evaluation Exercising s/w in order to uncover the errors and improve the quality of s/w. Maintenance After delivery of s/w. Modifications are done to correct errors, to improve performance. Challenges in Multi-core Programming 2/27/2014 7
  • 8. SOFTWARE DEVELOPMENT METHODOLOGY S/W DEVELOPMENT METHODOLOGIES DESCRIPTION CORE ACTIVITIES Agile Part of functionality is delivered at some time interval Planning, requirement analysis, design, implementation, testing and documentation Build and Fix s/w is build and modifications are done many times as needed Build initial version, modify as per customer’s requirements, At each iteration developer inform the client about time required. Client selects the desire feature Requirement gathering, specification, architectural design, implementation and integration, delivery s/w developed in increments. Integrated module by module Requirement gathering, specification, architectural design, build loop  Extreme Programming Incremental Challenges in Multi-core Programming 2/27/2014 8
  • 9. SOFTWARE DEVELOPMENT METHODOLOGY S/W DEVELOPMENT METHODOLOGIES  Object Oriented DESCRIPTION Objects are identified and with them s/w is designed At each iteration prototype of the Rapid prototyping system is developed. Interaction with client. Spiral Structured Waterfall CORE ACTIVITIES Requirement gathering, OO analysis, OO design, implementation and integration Rapid prototyping, specifications, design, implementation, integration, maintenance, retirement. Iterative model like incremental. Emphasis on risk analysis and verification at each phase Planning, risk analysis, evaluation Top down approach. Requirement analysis, design, Implementation, testing, development. c/as linear sequential model Rrq. Gathering and specification, design, imple, integration, 9 maintenance, retirement 2/27/2014 Challenges in Multi-core Programming
  • 10. CHALLENGES OF S/W DEVELOPMENT  1) S/W Decomposition: -> WBS & Architectural Artifacts (AAs) -> Decomposition is written in form of PROBLEM & SOLUTION CHALLENGES OF S/W DECOMPOSITION: 1) multiple ways to rep[resent a problem and its solution 2) making sure that decomposition is complete and correct. -> Finding right model for decomposition. Challenges in Multi-core Programming 2/27/2014 10
  • 11. CHALLENGES OF S/W DEVELOPMENT  2) Task To Task Communication: -> IPC ? -> Managing IPC: POSIX support six basic mechanisms to accomplish communication between processes. 1) Files with lock and unlock facility 2) Pipes 3) Shared Memory 4) Message Queues 5) Semaphore (use variables) 6) Sockets Challenges in Multi-core Programming 2/27/2014 11
  • 12. CHALLENGES OF S/W DEVELOPMENT  3) Concurrent Access To Data Or Resources By Multiple Tasks Or Agents: Three commonly occurring problems while executing the instructions concurrently:-> 1) Data race: When two or more tasks are attempting to update the data resource at the same time, the race condition occurs which is called as data race. 2) Deadlock: It is a situation in which two or more tasks are waiting for the other to finish so that they can acquire the resources. 3) Indefinite postponement: In this one or more tasks are waiting for some event or condition to occur and if that condition or event never occurs. Challenges in Multi-core Programming 2/27/2014 12
  • 13. CHALLENGES OF S/W DEVELOPMENT  4) Identifying Relationship Between Concurrently Executing Tasks: Four basic relationships 1) Start to Start 2) Finish to Start 3) Start to Finish 4) Finish to Finish 5) Controlling resource contention between tasks 6) Determining sufficient no. of processes or threads Challenges in Multi-core Programming 2/27/2014 13
  • 14. CHALLENGES OF S/W DEVELOPMENT  7 & 8) Finding reliable and reproducible debugging and testing -> Testing & debugging in sequential model. -> Difficult to produce exact content of parallel or concurrent tasks because of OS-scheduling policies, dynamic workload, process or thread priorities etc. -> Multiprocessing and multithreaded applications are nondeterministic in nature. That is recreation of the same sequence of events of these type of applications in order to test or debug the program is NOT POSSIBLE AT ALL. -> Finding the right debugger or profiler * state of the kernel process and system calls. * attach or detach a process or thread. 14
  • 15. CHALLENGES OF S/W DEVELOPMENT 9) Communicating the designs having multiprocessing components. -> UML (Unified Modeling Language) -> System Architecture (Structural Diagrams): 1) Component diagram: Represent the dependencies and organization among a set of physical modules. 2) Deployment diagram: shows runtime configuration of processing nodes, hardware and software components in a system. -> Behavioral Diagrams: 1) State diagram 2) Sequence diagram 3) Activity diagram 4) Collaboration diagram 15
  • 16. CHALLENGES OF S/W DEVELOPMENT 10) Implementing multiprocessing and multithreading in C++. -> C++ does not include any keyword primitives for parallelism. -> How can we implement the multiprocessing or multithreading applications using C++? (By using libraries) Challenges in Multi-core Programming 2/27/2014 16
  • 17. NEW LIBRARIES FOR C++ DEVELOPERS 1) System Libraries: -> Provides by O.S. itself -> Ex: POSIX thread Library. It contains the set of system calls that support parallelism. -> POSIX ( Portable O. S. Interface for Unix) * POSIX threads * POSIX spawn function * The exec() family of functions 2/27/2014 17
  • 18. PROCESSOR ARCHITECTURE CHALLENGES Four popularly used multi-core architectures1) Opteron 2) Cell 3) UltraSparc T1 4) Intel Core-2 -> These different architectures translate to different sets of compiler switches and directives. -> For this, it is necessary that the developer must be familiar with the use of compiler and linker specific features. -> In some cases multiple types of compilers needed to generate single executable program. -> But for taking the advantage of particular architecture we can make the s/w non-portable. -> So, taking most advantage of Multicore architecture without affecting the portability of the s/w application is the real challenge of processor architecture. 2/27/2014 18
  • 19. REFERENCE  1) “Professional Multicore Programming: Design and Implementation for C++ Developers “, Wiley India Edition, ISBN: 978-81-265-1875-3. 19