CS 603 Threads, Processes, and Agents March 18, 2002.

Slides:



Advertisements
Similar presentations
Processes Management.
Advertisements

©2009 Operačné systémy Procesy. 3.2 ©2009 Operačné systémy Process in Memory.
Processes: Code Migration Chapter 3 Will Cameron CSC 8530 Dr. Schragger.
Network Operating Systems Users are aware of multiplicity of machines. Access to resources of various machines is done explicitly by: –Logging into the.
Describe the concept of lightweight process (LWP) and the advantages to using LWPs Lightweight process (LWP) lies in a hybrid form of user-level & kernel-level.
1 Processes and Pipes COS 217 Professor Jennifer Rexford.
Processes CSCI 444/544 Operating Systems Fall 2008.
EECS122 - UCB 1 CS 194: Distributed Systems Processes, Threads, Code Migration Computer Science Division Department of Electrical Engineering and Computer.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Computer Science Lecture 8, page 1 CS677: Distributed OS Code and Process Migration Motivation How does migration occur? Resource migration Agent-based.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Learning Objectives Understanding the difference between processes and threads. Understanding process migration and load distribution. Understanding Process.
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
Communication in Distributed Systems –Part 2
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
Give an example to show the advantages to using multithreaded Clients See page 142 of the core book (Tanebaum 2002).
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
Processes.
Interprocess Communication. Process Concepts Last class.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems.
Introduction to Processes CS Intoduction to Operating Systems.
Threads, Thread management & Resource Management.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
Computer Science Lecture 8, page 1 CS677: Distributed OS Last Class Threads –User-level, kernel-level, LWPs Multiprocessor Scheduling –Cache affinity –Preemption.
Processes Chapter 3. Table of Contents Multithreading Clients and Servers Code Migration Software Agents (special topic)
Operating Systems Part III: Process Management (Process States and Transitions)
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Concurrent Programming. Concurrency  Concurrency means for a program to have multiple paths of execution running at (almost) the same time. Examples:
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Code Migration Russell T. Potee, III. Overview Why Code Migration? Code Migration Models Migration and Handling Resources Heterogeneous Systems Migration.
Computer Science Lecture 7, page 1 CS677: Distributed OS Multiprocessor Scheduling Will consider only shared memory multiprocessor Salient features: –One.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
Synchronization and semaphores Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 3 Operating Systems.
Chapter 3: Process-Concept. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
3.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Overview: Process Concept Process Scheduling Operations on Processes.
Department of Computer Science and Software Engineering
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Processes and Virtual Memory
The Mach System Silberschatz et al Presented By Anjana Venkat.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Acknowledgement: These slides are adapted from slides provided in Thißen & Spaniol's course Distributed Systems and Middleware, RWTH Aachen Processes Distributed.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Chapter 7 - Interprocess Communication Patterns
Threads. Readings r Silberschatz et al : Chapter 4.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
1 Parallel execution Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Problem On a regular basis we use: –Java applets –JavaScript –ActiveX –Shockwave Notion of ubiquitous computing.
Lecturer 3: Processes multithreaded Operating System Concepts Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess.
ECE 297 Concurrent Servers Process, fork & threads ECE 297.
Lecture 5 Page 1 CS 111 Online Process Creation Processes get created (and destroyed) all the time in a typical computer Some by explicit user command.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
OPERATING SYSTEM CONCEPT AND PRACTISE
Process Management Process Concept Why only the global variables?
Processes Overview: Process Concept Process Scheduling
Process Creation Processes get created (and destroyed) all the time in a typical computer Some by explicit user command Some by invocation from other running.
IPC and RPC.
Chapter 4: Processes Process Concept Process Scheduling
CS510 Operating System Foundations
Process/Code Migration and Cloning
Synchronization and semaphores
Presentation transcript:

CS 603 Threads, Processes, and Agents March 18, 2002

Goal: Operate at Remote Site Client-Server Model: –C–Client requests service –S–Scope of available services known in advance Remote Procedure Call –C–Call existing procedure at remote site Problem: Remote Site must already know what we want to do!

How is this handled in non-distributed system? –Write and run a program! Are there single-system analogues to starting arbitrary operation? –Processes –Threads

Process Model Basic idea: Virtual Machine Model “complete ownership” of machine –Memory –Files –Processing How does this fit with Distributed System? –It doesn’t Solution: Multiple Processes –Each process on different virtual machine –In Distributed System, different real machine

Multiple Processes: How Fork: Create child as “clone” of current process –Wouldn’t execution be same as parent? Process ID is new, as are a few other things Exit: Terminate process –Frees resources, closes files, etc. Wait: Parent waits for child to terminate –Block until child exits –What about multiple children?

Inter-process Communication Not very interesting if processes completely independent Files: Process can write and read same file –Synchronization difficulties Pipes: One-way FIFO buffer between processes –Sounds like stream-oriented communication Shared Memory –Explicitly declared shared area –Also semaphore primitive This is beginning to sound like a distributed system!

Remote Fork Why isn’t “Remote Fork” a primitive –Fork clones process Copies memory Same open file descriptors –Expensive at best, infeasible at worst Solution: Process as “local proxy” –Fork creates process –Child uses RPC/? to start remote execution

Threads Multiple activities in same address space –Process model creates new address space –Threads share – i.e., all memory is shared Shared variables for communication –Mutex – mutual exclusion primitive –Condition variable – wait/signal –Join – wait for particular process Even more difficult in distributed system –Requires distributed shared memory model Again use as local proxy to start remote code

So where are we? Models for Remote Processing –Server: Request documented service –RPC: Request execution of existing procedure What if operation we want isn’t offered remotely? Solution: Agents / Code Migration

Code Migration Process consists of: –Code –Resources (files, devices, etc.) –Execution (data, stack, registers, etc.) Fork copies everything –Is this needed? Solution: Copy part of the process

Types of Code Migration Weak mobility: Copy only code –Program starts from initial state –Example: Java applets Strong mobility: Copy code and execution –Resume execution where it stopped –But doesn’t necessarily have same resources (less than fork) –Example: D’Agents (later), cluster computing (Condor, LSF)

Types of Code Migration Sender Initiated Receiver Initiated Examples: –Java Applets Receiver Initiated –Cluster computing Sender Initiated? Central manager initiated?

Types of Code Migration Where executed? –In target process –In new process Strong Mobility: Move vs. Copy –Migrate process: Ceases at originating site –Clone process: Two copies in parallel

Types of Code Migration From Andrew Tanenbaum, Distributed Operating Systems, 1995.

The Hard Part: Resources Migrated process still needs resources Options to Connect to a Resource (Fugetta et al., 1998): –Binding by identifier (e.g., URL) Attach to the same resource –Binding by value (e.g., standard libraries) Bind to equivalent resource –Bind by type (e.g., “local printer”) Bind to resource with same function

The Hard Part: Resources Alternative: Move the Resource Unattached resources (e.g., data files) –Relatively easy to move Fastened resource (e.g., database) –Expensive to move Fixed resource (e.g., communications endpoint) –Can’t be moved

Resource Binding Resource to Machine Binding Process to Resource Binding UnattachedFastenedFixed IdentifierMoveGlobal Reference ValueCopy ValueGlobal Reference TypeRebind Locally Rebind locally Rebind Locally

What about Heterogeneity? Assumption: Same code runs at both source and target Weak mobility: Can compile/execute same source Strong mobility: More difficult –C/Pascal/etc.: Mobile only at subroutine call Use same mechanisms as RPC Translate parameters and stack/globals Return goes back to original machine –Java: Hide heterogeneity in virtual machine

What Next? Specific Example: D’Agents –Research Project at Dartmouth –Basic idea: Mobile agents –Based on Tcl Project 3 will use D’Agents –Still working on appropriately scoped task –Feel free to start reading –