TAILIEUCHUNG - Parallel Programming: for Multicore and Cluster Systems- P32

Parallel Programming: for Multicore and Cluster Systems- P32: Innovations in hardware architecture, like hyper-threading or multicore processors, mean that parallel computing resources are available for inexpensive desktop computers. In only a few years, many standard software products will be based on concepts of parallel programming implemented on such hardware, and the range of applications will be much broader than that of scientific computing, up to now the main application area for parallel computing | 302 6 Thread Programming a contention scope that is not supported by the specific Pthreads library the error value ENOTSUP is returned. Implicit Setting of Scheduling Attributes Some application codes create a lot of threads for specific tasks. To avoid setting the scheduling attributes before each thread creation Pthreads support the inheritance of scheduling information from the creating thread. The two functions int pthread_attr_getinheritsched const pthread_attr_t attr int inheritsched int pthread_attr_setinheritsched pthread_attr_t attr int inheritsched can be used to extract or set the inheritance status of an attribute data structure attr. Here inheritsched PTHREAD_INHERIT_SCHED means that a thread creation with this attribute structure generates a thread with the scheduling attributes of the creating thread ignoring the scheduling attributes in the attribute structure. The parameter value inheritsched PTHREAD_EXPLICIT_SCHED disables the inheritance . the scheduling attributes of the created thread must be set explicitly if they should be different from the default setting. The Pthreads standard does not specify a default value for the inheritance status. Therefore if a specific behavior is required the inheritance status must be set explicitly. Dynamic Setting of Scheduling Attributes The priority of a thread and the scheduling policy used can also be changed dynamically during the execution of a thread. The two functions int pthread_getschedparam pthread_t thread int policy struct scheiparam param int pthread_setschedparam pthread_t thread int policy const struct sched_param param can be used to dynamically extract or set the scheduling attributes of a thread with TID thread. The parameter policy defines the scheduling policy param contains the priority value. Figure illustrates how the scheduling attributes can be set explicitly before the creation of a thread. In the example SCHED_RR is used as scheduling policy. Moreover a .

TÀI LIỆU MỚI ĐĂNG
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.