A Multithreading C# Data Synchronization Program and Its Realization Course: ECE 1747H Parallel Programming Professor: Christiana Amza Student / Presenter:

Slides:



Advertisements
Similar presentations
Operating System.
Advertisements

Big Data Working with Terabytes in SQL Server Andrew Novick
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
ISYS 512 Business Application Design and Development with.Net David Chao.
Threads CSCI 444/544 Operating Systems Fall 2008.
Multithreading in Java Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Computer Measurement Group, India CLOUD PERFORMANCE TESTING - KEY CONSIDERATIONS Abhijeet Padwal, Persistent Systems.
Accelerating SQL Database Operations on a GPU with CUDA Peter Bakkum & Kevin Skadron The University of Virginia GPGPU-3 Presentation March 14, 2010.
Week 6 Operating Systems.
Introduction COMP104: Fundamentals and Methodology.
Report : Zhen Ming Wu 2008 IEEE 9th Grid Computing Conference.
Introduction to HP LoadRunner Getting Familiar with LoadRunner >>>>>>>>>>>>>>>>>>>>>>
Technology Expectations in an Aeros Environment October 15, 2014.
SSIS Over DTS Sagayaraj Putti (139460). 5 September What is DTS?  Data Transformation Services (DTS)  DTS is a set of objects and utilities that.
Computer System Architectures Computer System Software
Ihr Logo Data Explorer - A data profiling tool. Your Logo Agenda  Introduction  Existing System  Limitations of Existing System  Proposed Solution.
ISYS 512 Business Application Design and Development with.Net David Chao.
DBA Developer. Responsibilities  Designing Relational databases  Developing interface layer Environment Microsoft SQL Server,.NET SQL Layer: Stored.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
Introduction to .NET Framework
CSC 494/594 C# and ASP.NET Programming. C# 2012 C# Object-oriented language with syntax that is similar to Java.
Operating System. Architecture of Computer System Hardware Operating System (OS) Programming Language (e.g. PASCAL) Application Programs (e.g. WORD, EXCEL)
Part 1. Persistent Data Web applications remember your setting by means of a database linked to the site.
Computer Software Chapter 4 McGraw-Hill/IrwinCopyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved.
HDNUG 27-March-2007 SQL Server 2005 Suite as a Business Intelligence Solution.
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
ISYS 350 Business Application Development David Chao.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is Thread “Thread is a part of a program.
Principles of Information Systems, Sixth Edition Software: Systems and Application Software Chapter 4.
Principles of Information Systems, Sixth Edition Software: Systems and Application Software Chapter 4.
Full and Para Virtualization
ISYS 512 Business Application Design and Development with.Net David Chao.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
I am Xinyuan Niu I am here because I love to give presentations. Data Warehousing.
UNIVERSITY MANAGEMENT SYSTEM
VAR3 3.0 Platform and Project Orientation Analysis.
Threads Overview Benefits, User and Kernel Threads.
Computer System Structures
Aga Private computer Institute Prepared by: Srwa Mohammad
Operating System.
Foundations of .Net Programming with C#
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Java programming lecture one
Programming COMP104: Fundamentals and Methodology Introduction.
Module 0: Introduction Chapter 2: Getting Started
Download Microsoft Exam Dumps - Valid Microsoft Question Answers - Realexamdumps.com
Introduction to Java Dept. Business Computing University of Winnipeg
Chapter 6 System and Application Software
Ch 4. The Evolution of Analytic Scalability
Operating Systems Lecture 1.
Lecture 18 Syed Mansoor Sarwar
Lecture 1 Runtime environments.
Performance And Scalability In Oracle9i And SQL Server 2000
Chapter 6 System and Application Software
Chapter 6 System and Application Software
OPERATING SYSTEMS MEMORY MANAGEMENT BY DR.V.R.ELANGOVAN.
Chapter 6 System and Application Software
Course Instructor: Supriya Gupta Asstt. Prof
Nikola Grcevski Testarossa JIT Compiler IBM Toronto Lab
Presentation transcript:

A Multithreading C# Data Synchronization Program and Its Realization Course: ECE 1747H Parallel Programming Professor: Christiana Amza Student / Presenter: Bin Li Dec. 12, University of Toronto

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 2 Agenda  Background Problem & Solution Parallel Implementation Performance Measuring Other Approaches Future Work Q & A

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 3 Background (Company & Project) “Retail Value Canada Inc.” Markham-based Specialty Retailer 384 stores in Canada & USA, 30K types of items Head Office-side information maintained in Windows Store-side information maintained in Unix Data synchronization is needed Data type: product code, status, cost, price, promo, deal, subsidy, vendor, warehouse, etc. (by item, by store) Current application: iSync (developed in 2000 in Visual C# 1.0)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 4 Background (System Architecture)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 5 Agenda Background Background  Problem & Solution Parallel Implementation Performance Measuring Other Approaches Future Work Q & A

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 6 Problem & Solution Scheduled Data Synchronization (iSync process) starts at 10 pm, and ends at 12 am iSync extracts and transforms data from Windows into ASCII file (.dat), and sends it to Unix Mass data modification takes iSync quite a long time (4-5 hours) to run, which is over 2-hour schedule limit The latest change (i.e. prices) in head office cannot reach stores before the opening hour of the next business day

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 7 Problem & Solution (cont’d) The store-side information delay causes inaccurate sales information in retail stores Bottleneck: iSync (only 10% CPU usage on a 4- CPU database server)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 8 Problem & Solution (cont’d) Sequential program iSync generates.dat file by each store, which is slow Parallel solution Implementing qSync to replace iSync (using Microsoft C# multithreading) Parallelly generating.dat file by store groups

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 9 Agenda Background Background Problem & Solution Problem & Solution  Parallel Implementation Performance Measuring Other Approaches Future Work Q & A

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 10 Parallel Implementation Development Environment Design/UML Tool: Microsoft Visio 2003 Development Tool: Microsoft Visual Studio.NET 2003 Programming Language: Visual C# 2.0 (multithreading similar to Linux PThreads) Parallelization Steps Store Data Segmentation Parallel Data Processing Result Data Consolidation

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 11 Parallel Implementation (cont’d)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 12 User Interface (Screen 1)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 13 User Interface (Screen 2)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 14 Sample Code using System.Threading; private int getNbrOfInstance() {//... string sqlStmt = "select cast(RBSValue as int) from RulesBasedSystem " + "where RBSTxt = 'HISSPNbrOfInst' and RBSScopeKey = 'Retail Value'"; "where RBSTxt = 'HISSPNbrOfInst' and RBSScopeKey = 'Retail Value'";//...} HISSPCLPSyncComponent clpComponent = null; clpComponent = new HISSPCLPSyncComponent(); ThreadStart threadDelegate=null; Thread threadObj=null;

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 15 Sample Code (cont’d) for (int i=0; i<dtb.Rows.Count; i++) {//... threadDelegate = new ThreadStart(clpComponent.ExtCLPPrice); threadObj = new Thread(threadDelegate); threadObj.Name = Convert.ToString(i); threadList.Add(threadObj); //Start the thread threadObj.Start();} // Join the threads for (int i = 0; i<dtb.Rows.Count; i++) { threadObj = (Thread) threadList[i]; threadObj.Join();} while(j>0) //Approach #3 {lock(this){ consolidateCLPPrice(baseStoreId[j], itemBaseId[j], marketZoneId[j], itemPackId[j]); consolidateCLPPrice(baseStoreId[j], itemBaseId[j], marketZoneId[j], itemPackId[j]);}j--;}

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 16 Agenda Background Background Problem & Solution Problem & Solution Parallel Implementation Parallel Implementation  Performance Measuring Other Approaches Future Work Q & A

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 17 Performance Measuring Testing Environment Database Server Intel Xeon CPU 2.40 GHz, 4 CPUs, 3GB RAM Windows 2000 w/SP4, MS SQL Server 2000 Subset of real production data Web/Application Server Intel Pentium4, 2 CPU 3.40Ghz (HT), 2GB RAM Windows XP w/SP2, IIS 5.1 Performance Counters CPU % Usage Execution Time

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 18 Performance Comparison Number of Threads CPU Usage / Execution Time (sec) 1 (sequential) 10% % % % %370

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 19 Performance Comparison (cont’d) CPU % Usage Execution Time

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 20 Agenda Background Background Problem & Solution Problem & Solution Parallel Implementation Parallel Implementation Performance Measuring Performance Measuring  Other Approaches Future Work Q & A

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 21 Other Approaches (Approach #2) “Locking Temp Files”

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 22 Other Approaches (Approach #2 cont’d) “Locking Temp Files” All threads write to single.dat file Using lock for file appending Result: bad as sequential Explanation: same disk file cannot be shared simultaneously by different threads, needs to close/re-open (different from shared memory)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 23 Other Approaches (Approach #3) “Locking Temp Tables”

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 24 Other Approaches (Approach #3 cont’d) “Locking Temp Tables” All threads share single temporary database table Using lock for table record inserting Result: much better than sequential, not as good as the Main Approach Explanation: database server has enough memory; lock brings slight delay

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 25 Agenda Background Background Problem & Solution Problem & Solution Parallel Implementation Parallel Implementation Performance Measuring Performance Measuring Other Approaches Other Approaches  Future Work Q & A

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 26 Further Work Database Parallelism Upgrading SQL Server 2000 to 2005 Migrating C# code of data synchronization to database stored procedures, optimizing SQL queries Changing temporary table(s) to permanent schema Using SQL Server Integration Services (SSIS 2005) to do parallel data load & transformation Accessing permanent table (which contains final data to be synchronized) to generate.dat file

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 27 Q & A Thanks!

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 28 Additional Slide for Q&A (C#) C# (pronounced “C Sharp”) Microsoft.NET Framework-compliant language Simple, modern, object oriented programming language derived from C and C++ Aims to combine the high productivity of Visual Basic and the raw power of C++. C# vs Java Similar but not same in language specifications Compilation: C# to Microsoft Intermediate Language (MSIL), and Java to Java bytecode Running: C# in Common Language Runtime (CLR), Java in Java Virtual Machine (JVM)

Parallel Programming Professor: Christiana Amza Student: Bin Li Dec.12, University of Toronto 29 Additional Slide for Q&A (Main Approach vs Approach #3)