Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single.

Similar presentations


Presentation on theme: "© 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single."— Presentation transcript:

1 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Parallel programming in an AutoCAD application Gopinath Taget Senior Developer Consultant

2 © 2011 Autodesk Gopinath Taget Autodesk Developer Network Americas Autodesk, Inc. Gopinath Taget is a member of the Autodesk Developer Technical Services Team. He has more than 7 years of experience developing and supporting AutoCAD APIs, including ObjectARX,.NET, VBA and LISP. Gopinath also has several years of experience in software development on other CAD platforms, including Microstation, Solidworks, and CATIA -- mainly using C++ and technologies such as MFC and COM. Gopinath was also involved in the development of Web-based applications for MapGuide and AutoCAD Map 3D. Gopinath has Master degrees in Civil Engineering and Software Systems. About Me

3 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Class Summary In this class you will learn about  Problems implementing parallelism in an AutoCAD application  Which portions of an application can be safely parallelized  Latest.NET and C++ libraries for parallelism  Synchronizing parallel execution in AutoCAD application

4 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Learning Objectives At the end of this class, you will be able to:  Implement parallelism in an AutoCAD application  Understand safe methods for parallelism in an AutoCAD application  Understand technologies and APIs available to implement parallelism

5 © 2011 Autodesk Issues with Parallel Programming in AutoCAD

6 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 AutoCAD is an MFC Application  AutoCAD UI accessible only from UI thread  AutoCAD Objects accessible only from UI thread  Only one UI thread  Only one message loop

7 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 AutoCAD is not Thread Safe  No way to lock AutoCAD objects  AutoCAD idle state can be complex to determine  Idle state can be broken in unexpected ways  Only message queue determines what gets executed  Message queue too fine grained  Lots of scope for race conditions

8 © 2011 Autodesk “Safe” Parallel Programming in AutoCAD

9 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Best Practices  Asynchronous programming is your friend  IsQuiescent is your friend  Always use the AutoCAD message loop  Use ActiveX API if you can  Only perform non-Acad operations in threads

10 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Separate Executables  Poor man’s parallelism  Send Messages to AutoCAD instance  Use COM to communicate and control AutoCAD  Other IPC technologies to exchange data

11 © 2011 Autodesk Useful Technologies for Parallel Programming

12 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3.NET Task Parallel Library  Available with.NET 4.0  Concurrency made easy  Integrated with LINQ to make PLINQ  Optimizes based on CPU architecture

13 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Microsoft C++ Concurrency Runtime  High level of abstraction  Two programming models  Asynchronous Agents Library (Actor based library)  Parallel Pattern Library (Imperative Programming)  Allows customization of scheduler  Resource manager as abstraction of hardware

14 © 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single Job 6 Processor 2 Processor 3 Autodesk, AutoCAD* [*if/when mentioned in the pertinent material, followed by an alphabetical list of all other trademarks mentioned in the material] are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document. © 2011 Autodesk, Inc. All rights reserved.


Download ppt "© 2011 Autodesk Single Job 1 Processor 1 Single Job 2 Single Job 3 Processor 2 Processor 3 Big Job 1 Big Job 2 Single Job 4 Processor 1 Single Job 5 Single."

Similar presentations


Ads by Google