Threading Models in Visual Basic Language Student Name: Danyu Xu Student ID:98044.

Slides:



Advertisements
Similar presentations
Chapter 4 Threads Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Advertisements

Threads, SMP, and Microkernels
COM vs. CORBA.
Software Architectural Design Software Components Instructor Dr. Lawrence Chung.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Computer Systems/Operating Systems - Class 8
Day 10 Threads. Threads and Processes  Process is seen as two entities Unit of resource allocation (process or task) Unit of dispatch or scheduling (thread.
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Threads. Processes and Threads  Two characteristics of “processes” as considered so far: Unit of resource allocation Unit of dispatch  Characteristics.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
1 I/O Management in Representative Operating Systems.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Intro to COM What is it and what can it do for me?
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Visual Basic: An Object Oriented Approach 12 – Creating and using ActiveX objects.
CSC Proprietary 9/11/2015 2:16:16 AM 008_P2_CSC_white 1.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
Threads, Thread management & Resource Management.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Component Object Model
Object Oriented Programming Dr. Ennis-Cole CECS 5100.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Threads G.Anuradha (Reference : William Stallings)
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Processes Introduction to Operating Systems: Module 3.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
GAM666 – Introduction To Game Programming ● DirectX is implemented as a collection of COM objects ● To use a DirectX program, the user must have the correct.
Multithreaded Programing. Outline Overview of threads Threads Multithreaded Models  Many-to-One  One-to-One  Many-to-Many Thread Libraries  Pthread.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is Thread “Thread is a part of a program.
COM / DCOM Xiaolan Lu Mingzhen Wang Dong Xie. Why COM / DCOM?  Challenges facing the software industry  Component software provides a solution  General.
Department of Computer Science and Software Engineering
Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)
Operating Systems: Internals and Design Principles
Windows Threading Colin Roby Jaewook Kim.
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
Copyright © 2004, Keith D Swenson, All Rights Reserved. OASIS Asynchronous Service Access Protocol (ASAP) Tutorial Overview, OASIS ASAP TC May 4, 2004.
Creating Simple and Parallel Data Loads With DTS.
1 Threads, SMP, and Microkernels Chapter 4. 2 Process Resource ownership - process includes a virtual address space to hold the process image Scheduling/execution-
Threads, SMP and Microkernels Process vs. thread: –Unit of resource ownership (process has virtual address space, memory, I/O channels, files) –Unit of.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Computer System Structures
Introduction to threads
Chapter 3: Windows7 Part 5.
OPERATING SYSTEM CONCEPT AND PRACTISE
Processes and threads.
Apartments and COM Threading Models
Day 12 Threads.
Chapter 2: System Structures
Chapter 4 Threads.
Out-of-Process Components
KERNEL ARCHITECTURE.
Chapter 3: Windows7 Part 5.
Chapter 15, Exploring the Digital Domain
CHAPTER 4:THreads Bashair Al-harthi OPERATING SYSTEM
Multithreaded Programming
Out-of-Process Components
Presented By Justas Raslanas
CS Introduction to Operating Systems
Presentation transcript:

Threading Models in Visual Basic Language Student Name: Danyu Xu Student ID:98044

Process/Thread Process  Execution of an individual program  3 Components - An executable program - Associated data needed by the Program -Execution by the Program All information the O/S needs to manage the process Thread  A dispatchable unit of work  An execution state(running,ready,etc.)  Some per-thread static storage for local variables  Access to the memory and resources of its process

Benefits of a Thread  Less time to create a new thread than a process  Less time to terminate than a process  Less time to switch between two threads within the same process  Since threads within the same process share same files and memory, they can communicate with each other without invoking the kernel

COM(Component Object Model) in Visual Basic  a software architecture that allows applications to be built from binary software components.  the underlying architecture that forms the foundation for higher-level software services, eg. OLE, ActiveX.

COM(Component Object Model) in Visual Basic (Continued)  A mechanism for keeping track of whether an object is in use and deleting it when no longer needed.  A standard error-reporting mechanism and set of error codes and values.  A mechanism for apps to exchange objects.

In-Process Server Component in VB-DLL  In-Process are always DLL (dynamic link libraries) files. DLL-A library containing API functions or procedures accessible to and called from an application. -ideal for implementing standard objects to reuse or share among apps. -ideal for defining interfaces implemented by other objects. -preferred to create high-performance objects without a user interface.

In-Process Server Component in VB-DLL (Continued) -Windows API(Application Programming Interface) has a collection of functions and procedures stored in Dynamic- Link Libraries.

Out-of-Process Server Component  Out-of-Process are always EXE (executable) files. -objects can execute in their own thread. -objects can be created and used both by client applications and by running the server as a standalone app.

Difference Between DLL and EXE  The way Windows interacts with them

Memory Organization of 16-bit OS Code for DLL A Data for DLL A Code for EXE B Data for EXE B Code for EXE A Data for EXE B -windows 3.x -if a program accidentally modifies another program’s memory, can bring down the system. -Every application has one and only one thread.

Memory Organization of 32-bit OS Code for EXE A Code for DLL A Data for EXE A Data for DLL A =============== Code for DLL A Data for DLL A Code for EXE A Data for EXE A --process space – the memory app runs in --walled off from other app --lower level physical memory is shared WinNT Each object could have its own thread, or the app ;might have a fixes number of threads and could manage its objects across the threads.

Communications Between Apps Under 32-bit OS  Mechanism of Marshalling  Proxy object – fake object exposes same interface as the actual object. -created by OLE.  Types of Marshalling: --Between Apps --Between networks(DCOM,overhead of marshalling function calls is negligible compared to transfer of large amount of data)

Features of In-Process and Out-of-Process server EXE -It can run as a stand-alone application apart from the client -does not share same address space under the OS. DLL -server component and client share some of the same memory. - share the same executable space.

Features of In-Process and Out-of-Process Server (Continued)  Performance --In-Process server shares the same process space with its client at run time --server and client share some of the same memory. --Public Creatable classes can be instantiated only as MultiUse objects.  Flexibility Out-of-Process server provide classes either SingleUse or MultiUse

Threading Models  Apartment Threading Model (single threaded apartments)  Free Threading Model (multi threaded apartments)  Thread Neutral Apartment Model

Apartment Threading Model A “logical container” that -creates an association between objects and, in some cases, threads. -a set of rules programmers must obey to receive the concurrency behavior they expect from COM environment. -system-supplied code that helps programmers manage thread concurrency with respect to COM objects. -object in each thread is unaware of objects in other threads and has its own separate copy of global data.

SingleUse/MultiUse  A SingleUse Class can only supply one instance of itself  One Instance – one server component  A MultiUse class can supply more than one instance of itself per copy of its component.  One server component – many instance

SingleUse/MultiUse (Continued)  Cons:high overhead  Pros:avoid blocking Blocking - >1 user try to call the same code at the same time.

Single-threaded apartment (STA)  a set of COM objects associated with a particular thread.  a place where an object or a proxy "lives."

Multi-Threaded Apartment (MTA)  a set of COM objects associated with a set of threads in the process such that any thread can call any object implementation directly without the interposition of system code.

Thread Neutral Apartment Model  MTS