Tom,
Looking here:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg31/4.4
<quote>
For the data that you want to isolate to an individual program invocation
instance, define the data in the LOCAL-STORAGE SECTION. In general, this
choice is appropriate for working data in threaded programs. If you declare
data in WORKING-STORAGE and your program changes the contents of the data,
you must take one of the following actions:

Structure your application so that you do not access data in
WORKING-STORAGE simultaneously from multiple threads.

If you do access data simultaneously from separate threads, write
appropriate serialization code.
</quote>

But there doesn't seem to be any hint of how to "write appropriate
serialization code". Too bad COBOL can't declare a variable "ATOMIC" or
have some sort serialization primitive like some other languages. I rather
like the "synchronized" in Java. But, of course, COBOL is not really
designed for multi-threading. If I want to do "heavy duty" threading and
concurrency, I'd choose Clojure. Why? Because it is designed for it _AND_
it runs on the JVM which means it can run on a zAAP.



On Thu, May 8, 2014 at 1:02 AM, 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!
>
> Cheers,
> TomR              >> COBOL is the Language of the Future! <<
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
There is nothing more pleasant than traveling and meeting new people!
Genghis Khan

Maranatha! <><
John McKown

----------------------------------------------------------------------
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