TAILIEUCHUNG - distributed operating system phần 4

Tuy nhiên, các thông tin trong cuốn sách này được bán mà không có sự bảo đảm, thể hiện rõ ràng hay ngụ ý. Không phải là tác giả, xuất bản Packt, cũng không phải các đại lý hoặc nhà phân phối sẽ được tổ chức chịu trách nhiệm về bất kỳ thiệt hại gây ra | 178 PROCESSES AND PROCESSORS IN DISTRIBUTED SYSTEMS CHAP. 4 Alternatively new library procedures can be introduced to create set and read these thread-wide global variables. The first call might look like this create_global C bufptr It allocates storage for a pointer called bufptr on the heap or in a special storage area reserved for the calling thread. No matter where the storage is allocated only the calling thread has access to the global variable. If another thread creates a global variable with the same name it gets a different storage location that does not conflict with the existing one. Two calls are needed to access global variables one for writing them and the other for reading them. For writing something like set_global bufptr buf will do. It stores the value of a pointer in the storage location previously created by the call to create-global. To read a global variable the call might look like bufptr read-global C bufptr This call returns the address stored in the global variable so the data value can be accessed. Our last design issue relating to threads is scheduling. Threads can be scheduled using various scheduling algorithms including priority round robin and others. Threads packages often provide calls to give the user the ability to specify the scheduling algorithm and set the priorities if any. . Implementing a Threads Package There are two main ways to implement a threads package in user space and in the kernel. The choice is moderately controversial and a hybrid implementation is also possible. In this section we will describe these methods along with their advantages and disadvantages. Implementing Threads in User Space The first method is to put the threads package entirely in user space. The kernel knows nothing about them. As far as the kernel is concerned it is managing ordinary single-threaded processes. The first and most obvious advantage is that a user-level threads package can be implemented on an operating system that does not .

TỪ KHÓA LIÊN QUAN
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.