On 22 February 2017 at 11:16, Joseph Reichman <[email protected]> wrote: > I know if you specify GSPV or SHPSV on the attach tasks can Share ? A subpool > If this is not specified on the attach would a subtask get a S0C4 for > referencing storage > Obtained by the originating task
Use of subpools (I'm speaking of ordinary subpools in the range of 0-127 - not CSA or the like), and whether they're shared or not, has to do with storage management, not with access control. You can ATTACH a subtask without sharing a subpool, that task can GETMAIN some storage, and the ATTACHing task can then reference it. Likewise the ATTACHed task can reference storage acquired by the ATTACHing task. This is perfectly legitimate, but it's up to you to make sure that one task doesn't free storage that the other will access. You need to design and write this stuff; MVS won't manage it for you. By default, when you ATTACH a subtask, subpool 0 is shared, and no others are. And since subpool 0 is the default for GETMAIN in most cases, if your subtask obtains storage, that storage will not go away when the subtask terminates, because it's owned by the ATTACHing task. So you can easily make the mistake of ATTACHing the same subtask multiple times, and if the subtask doesn't free its storage, you will have a memory leak. It can be convenient either to not share subpool 0 (SZERO=NO), or to have the subtask use a different unshared subpool (123 or something) for working space it gets, and then there is no need for cleanup in the subtask. Again, none of this relates directly to access to the storage, S0C4s or the like. Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
