Jon,

Its not my call ….I am only the guy asking the questions. 









From: Jon Perryman
Sent: ‎Thursday‎, ‎May‎ ‎8‎, ‎2014 ‎10‎:‎05‎ ‎AM
To: IBM Mainframe Discussion List





I personally would STRONGLY discourage this implementation. You're not the only 
one in your environment.

Why not do it correctly and allocate from shared storage pool. Use either C's 
or assemblers implementation. Remember if you do it once, someone else will 
think this clever and use it without fully understanding why it works.


The Cobol guide has a section on multithreading. I've never read it but you 
should at least follow it's guidelines.

Yes it will work but it's not even done this way in C and we should not do this 
in assembler. Multi-tasking is allowed in assembler (ATTACH) and C (threading) 
but not in most other languages. By violating C's implementation of global 
variables, you are doing something they don't expect. Cobol user's don't 
multi-task so they are not familiar with this. In the best error situation you 
get an abend. In the worst, some other threads storage will get stomped on and 
the receivng program will reference bad data. 

Jon Perryman


On Wednesday, May 7, 2014 11:02 PM, Tom Ross <tmr...@stlvm20.vnet.ibm.com> 
wrote:
 
>I have written a C program using threads and have a question. I have an ext=
>>ernal message table that I need to be persistent between threads.  The mess=
>>age table is loaded from an external QSAM file. Program in Cobol loads the =
>>table. I want to be able to use the message table in other threads. Does an=
>>yone know is Working-Storage from one thread available to other threads ?=20
>
>Yes!  In fact, all of your COBOL threads would be using a single copy of
>WORKING-STORAGE, so if one of them wants to do something that does not affect
>the others then the programs need LOCAL-STORAGE variables.  Normally with
>multi-threading you would not use WORKING-STORAGE because of this.  In your
>case, defining your table in WORKING-STORAGE and your other variables in
>LOCAL-STORAGE would work great!
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to