tailieunhanh - distributed operating system phần 10
cuốn sách này có thể được sao chép, lưu trữ trong hệ thống phục hồi, hoặc truyền đi dưới bất kỳ hình thức nào hoặc bằng bất cứ phương tiện nào, mà không cần sự cho phép trước bằng văn bản của nhà xuất bản, ngoại trừ trong trường hợp trích dẫn ngắn gọn | 532 CASE STUDY 4 DCE CHAP. 10 interest in a child and does not plan to wait for it the parent can disown the child by calling detach. In this case when the child thread exits its storage is reclaimed immediately instead of having it wait for the parent to call join. The DCE package allows the user to create destroy and manage templates for threads mutexes and condition variables. The templates can be set up to have appropriate initial values. When an object is created one of the parameters to the create call is a pointer to a template. For example a thread template can be created and given the attribute property that the stack size is 4K. Whenever a thread is created with that template as parameter it will get an 4K stack. The point of having templates is to eliminate the need for specifying all the options as separate parameters. As the package evolves the create calls can remain the same. Instead new attributes can be added to the templates. Some of the template calls are listed in Fig. 10-7. Call Description Attr_create Create template for setting thread parameters Attr_delete Delete template for threads Attr_setprio Set the default scheduling priority in the template Attr_getprio Read the default scheduling priority from the template Attr_setstac ksi ze Set the default stack size in the template Attr_getstacksize Read the default stack size from the template Attr_mutexattr_create Create template for mutex parameters Att r_m utexattr_de 1 ete Delete template for mutexes Attr_mutexattr_setkind_np Set the default mutex type in the template Attr_mutexattr_getkind_np Read the default mutex type from the template Attr_condattr_create Create template for condition variable parameters Attr_condattr_delete Delete template for condition variables Fig. 10-7. Selected template calls. The attr_create and attr delete calls create and delete thread templates respectively. Other calls allow programs to read and write the template s attributes such as the stack size and .
đang nạp các trang xem trước