Comparing POSIX Multithreading to z/OS Multitasking


 
Although the z/OS operating system has the ability to dispatch multiple threads of execution, it is different from the POSIX definition. To compare the two, you must first understand the meaning of some key C and POSIX constructs.
 
 
Heap
The area of memory from which dynamic storage is allocated using the ANSI memory allocation routines like  malloc(), calloc()free(), and so on.
 
  
Static Area
The area of memory where global variables (variables declared outside the scope of the  main() program or outside the scope of any subroutines) and string constants (string values that appear within double quotation marks within a program) are stored. Variables that are declared  static  within the scope of a subroutine are also stored in this area.
 
  
Stack
The area of memory used for parameter passing and for storing automatic variables (variables defined within the scope of  main() program or any subroutine).
 
  
Process
A single program that consists of one  main() program and any number of subroutines. Each process has its own heap and static area.
 
  
Thread
A subroutine dispatched as a separate executable entity from the  main() program (which itself is also a thread).
 
  
task
A TASK (in z/OS) is a unit of execution. POSIX threads, as used by DCE, are mapped to z/OS tasks (TCBs). These mappings occur in two flavors:
 
   
  • heavy weight
     pthread creation is the same as task creation, and pthread deletion is the same as task deletion (TCB DETACH). z/OS resource managers are run. 
     
  • medium weight
     pthread creation is an association of a thread with an existing z/OS TCB on a one-for-one basis. pthreaddeletion ends this association; the z/OS task is not DETACHed and z/OS resource managers are not run. 

DCE uses medium weight threads.

The key distinction between z/OS tasking and POSIX threading  is that each z/OS task is close to being a separate process, whereas each POSIX thread is actually a program subroutine. Refer to below  for a comparison of threads to processes. In the following sections, the term  thread  refers to the POSIX execution entity, while the term  task  refers to the z/OS execution entity.
 
 PICTURE 54 




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值