freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

[工學]西安交通大學操作系統(tǒng)原理課件第三章(參考版)

2025-02-20 14:27本頁面
  

【正文】 Pointer indicating the share memory address NULL: selecting by OS 1:read only 0:R/W MODE:READ,WRITE,OR BOTH Examples of IPC Systems Mach ? Mach munication is message based – Even system calls are messages – Each task gets two mailboxes at creation Kernel and Notify – Only three system calls needed for message transfer msg_send(), msg_receive(), msg_rpc() – Mailboxes needed for munication, created via port_allocate() Examples of IPC Systems – Windows XP ? Messagepassing centric via local procedure call (LPC) facility – Only works between processes on the same system – Uses ports (like mailboxes) to establish and maintain munication channels – Communication works as follows: ? The client opens a handle to the subsystem’s connection port object客戶機打開子系統(tǒng)連接端口對象的句柄 ? The client sends a connection request客戶機發(fā)送連接請求 ? The server creates two private munication ports and returns the handle to one of them to the client ? The client and server use the corresponding port handle to send messages or callbacks and to listen for replies Local Procedure Calls in Windows XP in ClientServer Systems ? Sockets ? Remote Procedure Calls ? Remote Method Invocation (Java) Sockets ? A socket is defined as an endpoint for munication ? Concatenation of IP address and port ? The socket :1625 refers to port 1625 on host ? Communication consists between a pair of sockets Socket Communication Remote Procedure Calls ? Remote procedure call (RPC) abstracts procedure calls between processes on worked systems ? Stubs – clientside proxy for the actual procedure on the server存根是遠程服務器上的過程在客戶端的代理 ? The clientside stub locates the server and marshalls the parameters客戶端的存根定位服務器并編組參數 ,向服務器發(fā)送消息 ? The serverside stub receives this message, unpacks the marshalled parameters, and peforms the procedure on the server Remote Method Invocation ? Remote Method Invocation (RMI) is a Java mechanism similar to RPCs ? RMI allows a Java program on one machine to invoke a method on a remote object Marshalling Parameters 作 業(yè) ? P116 – – 。 – Now the process could write to the shared memory sprintf(shared memory, Writing to shared memory)。 implemented in one of three ways: 1. Zero capacity – 0 messages Sender must wait for receiver 2. Bounded capacity – finite length of n messages Sender must wait if link full 3. Unbounded capacity – infinite length Sender never waits Examples of IPC Systems POSIX ? POSIX Shared Memory – Process first creates shared memory segment segment id = shmget(IPC PRIVATE, size, S IRUSR | S IWUSR)。 } Message Passing ? Mechanism for processes to municate and to synchronize their actions ? Message system – processes municate with each other without resorting to shared variables ? IPC facility provides two operations: – send(message) – message size fixed or variable – receive(message) ? If P and Q wish to municate, they need to: – establish a munication link between them – exchange messages via send/receive ? Implementation of munication link – physical (., shared memory, hardware bus) – logical (., logical properties) Message Passing ? Direct Communication ? Indirect Communication Message Passing Direct Communication ? Processes must name each other explicitly: – send (P, message) – send a message to process P – receive(Q, message) – receive a message from process Q ? Properties of munication link – Links are established automatically – A link is associated with exactly one pair of municating processes – Between each pair there exists exactly one link – The link may be unidirectional, but is usually bidirectional Message Passing Indirect Communication ? Messages are directed and received from mailboxes (also referred to as ports) – Each mailbox has a unique id – Processes can municate only if they share a mailbox ? Properties of munication link – Link established only if processes share a mon mailbox – A link may be associated with many processes – Each pair of processes may share several munication links – Link may be unidirectional or bidirectional Message Passing Indirect Communication ? Operations – create a new mailbox – send and receive messages through mailbox – destroy a mailbox ? Primitives are defined as: send(A, message) – send a message to mailbox A receive(A, message) – receive a message from mailbox A Indirect Communication ? Mailbox sharing – P1, P2, and P3 share mailbox A – P1, sends。 out = (out + 1) % BUFFER SIZE。 } Bounded Buffer – Consumer while (true) { while (in == out) 。 /* do nothing no free buffers */ buffer[in] = item。 int out = 0。 item buffer[BUFFER_SIZE]。 lockf(1,0,0)。i100。 } else { lockf(1,1,0)。i++) printf(daughter %d\n,i)。 for(i=0。 } else 續(xù)下頁 實例 3 { while((p2 = fork()) == 1)。i++) printf(son %d\n,i)。 for(i=0。 while((p1 = fork()) == 1)。父進程 } } 實例 3 2 進程的控制
點擊復制文檔內容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1