1 / 19

Processes

Processes. Chapter 3. Part II Clients and Servers. Clients. Main role of clients is: User Interface (UI) Client-side software UI: Major task Need not be graphical (GUI) Not all clients have UI?. The X-Window System. The basic organization of the X Window System. Client-Side Software.

malik-rojas
Download Presentation

Processes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Processes Chapter 3 Part II Clients and Servers

  2. Clients • Main role of clients is: • User Interface (UI) • Client-side software • UI: • Major task • Need not be graphical (GUI) • Not all clients have UI?

  3. The X-Window System • The basic organization of the X Window System

  4. Client-Side Software • UI is a small part of the client-side S/W • Client S/W includes: • Local processing • Communication facilities • Client S/W should provide replication transparency when sever is replicated

  5. Client-Side Software for Distribution Transparency Common interface to Service Client or Server side • A possible approach to transparent replication of a remote object using a client-side solution.

  6. Client S/W - Transparency • Clients can guarantee: • Distribution, • Access, and • Failure transparency • How about: • Concurrency and • Persistence transpareny ?

  7. Servers • A process implementing a service for clients • Server waits for client requests, service them, and repeats • Can be Sequential or Concurrent • Clients send requests to an endpoint (port) at the server machine • What if the server is assigned a dynamic port?

  8. Servers with Dynamic Ports 3.7 • Client-to-server binding using a daemon as in DCE • Client-to-server binding using a superserver as in UNIX

  9. Stateless versus Stateful Servers • Stateless: do not keep information on clients’ state • Stateful: maintain client’s state between different requests: • Context, transactions, user preferences, login? • Cookies

  10. Object Servers • Tailored for distributed objects support • Provides environment for objects • Not a service by itself (government) • Services are provided by objects • Easy to add services

  11. Activation Policies • Decisions on how to invoke objects • All objects are alike • Inflexible • Objects differ and require different policies • Object type • Memory allocation • Threading

  12. Transient Objects • Create at the first invocation request and destroy when clients are no longer bound to it • Create all transient objects when server is initialized • Server resources? • Invocation time?

  13. Memory Allocation • Each object has its own memory segment • Objects can share memory segments • Security? • Memory resources?

  14. Threads • One thread in the server • Several threads in the server • Separate thread for each object • Separate thread for each request • Concurrent access? • On-demand threads or thread-pools

  15. Object Adapters (Wrappers) • A S/W implementation of an activation policy • Generic to assist developers • Group objects per policy • Several objects under an adapter • Several adapters under a server

  16. Object Adapter (1) • Organization of an object server supporting different activation policies.

  17. Object Adapter (2) /* Definitions needed by caller of adapter and adapter */#define TRUE#define MAX_DATA 65536 /* Definition of general message format */struct message { long source /* senders identity */ long object_id; /* identifier for the requested object */ long method_id; /* identifier for the requested method */ unsigned size; /* total bytes in list of parameters */ char **data; /* parameters as sequence of bytes */}; /* General definition of operation to be called at skeleton of object */typedef void (*METHOD_CALL)(unsigned, char* unsigned*, char**); long register_object (METHOD_CALL call); /* register an object */void unrigester_object (long object)id); /* unrigester an object */void invoke_adapter (message *request); /* call the adapter */ • The header.h file used by the adapter and any program that calls an adapter.

  18. Object Adapter (3) typedef struct thread THREAD; /* hidden definition of a thread */ thread *CREATE_THREAD (void (*body)(long tid), long thread_id);/* Create a thread by giving a pointer to a function that defines the actual *//* behavior of the thread, along with a thread identifier */ void get_msg (unsigned *size, char **data);void put_msg(THREAD *receiver, unsigned size, char **data);/* Calling get_msg blocks the thread until of a message has been put into its *//* associated buffer. Putting a message in a thread's buffer is a nonblocking *//* operation. */ • The thread.h file used by the adapter for using threads.

  19. Object Adapter (4) • The main part of an adapter that implements a thread-per-object policy.

More Related