TAILIEUCHUNG - THE JR PROGRAMMING LANGUAGE phần 4

So sánh hiệu suất của chương trình này câu trả lời của bạn một phần (a). 1,4 (a) Thực hiện các chương trình tìm kiếm tập tin đồng thời bằng cách sử dụng các mẫu khác nhau và các tập tin trên một hệ thống UNIX. So sánh các đầu ra của lệnh grep. | 94 Remote Procedure Call private static int p int x return x 4 public static void main String args The above code can be written equivalently as follows public class SRPairl private static op void p int private static op void r int private static process q int a b send p a receive r b private static void p int x send r x 4 public static void main String args The operation p has been replaced by a new version of p and a new results operation r. Note that p is now declared as having no return type . void the return value is now passed back as the parameter of r. The call to the method has been replaced by a send receive pair. The send passes the parameter to p the receive gets the result back from p. The above code works as long as only one process is invoking p. However if more than one process invokes p each needs its own local results operation. For this we can use local operations and capabilities as we did in class Model4 in Section . For example suppose q is now a family of processes each of which invokes p public class RPC2 private static op int p int private static process q int i 1 i 20 i int a b b p a private static int p int x return x 4 Equivalence to Send Receive Pairs 95 public static void main String args This code can be written equivalently as follows public class SRPair2 private static op void p int cap void int private static process q int i 1 i 20 i int a b op void r int send p a r receive r b private static void p int X cap void int r send r x 4 public static void main String args Here the operation p has been replaced by a new version the new second argument is a capability for an operation that is used to return the result. Each invoking process now declares a local operation r. Again the call to the method has been replaced by a send receive pair. A sending process passes the capability for its r to p p sends results back to that operation. The structure of the above code is very similar to what we saw earlier in the client-server .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.