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

Parallel Programming: for Multicore and Cluster Systems- P37: 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 | 352 6 Thread Programming Besides the explicit flush construct there is an implicit flush at several points of the program code which are a barrier construct entry to and exit from a critical region at the end of a parallel region at the end of a for sections or single construct without nowait clause entry and exit of lock routines which will be introduced below . Locking Mechanism The OpenMP runtime system also provides runtime library functions for a synchronization of threads with the locking mechanism. The locking mechanism has been described in Sect. and in this chapter for Pthreads and Java threads. The specific locking mechanism of the OpenMP library provides two kinds of lock variables on which the locking runtime routines operate. Simple locks of type om loctt can be locked only once. Nestable locks of type ompnestdoctt can be locked multiple times by the same thread. OpenMP lock variables should be accessed only by OpenMP locking routines. A lock variable is initialized by one of the following initialization routines void omp_init_lock om loctt lock void omp_init_nest_lock om _nesLlockt lock for simple and nestable locks respectively. A lock variable is removed with the routines void ompdestroylock om loctt lock void omp_destroy_nest_lock om _nesLloctt lock . An initialized lock variable can be in the states locked or unlocked. At the beginning the lock variable is in the state unlocked. A lock variable can be used for the synchronization of threads by locking and unlocking. To lock a lock variable the functions void ompseLlock om lockt lock void ompseLnestlock omp_nest_loc ct lock are provided. If the lock variable is available the thread calling the lock routine locks the variable. Otherwise the calling thread blocks. A simple lock is available when no other thread has locked the variable before without unlocking it. A nestable lock variable is available when no other thread has locked the variable without unlocking it or when the calling .

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.