PL/I

PL/I

PL/I

 View Only
Expand all | Collapse all

Multithreading with file handling

  • 1.  Multithreading with file handling

    Posted Fri July 29, 2016 06:04 AM

    Dear PL/i Cafe - Community!
     

    I'm trying to call existing (old/very old) pl/i modules from a thread, created with the ATTACH Statement. The pl/i modules contain sequential file access.

     

    My test results in the following picture: Files are shared between all threads. If one thread reads the first line, a parallel thread is getting the second line on its first read access,... and so on. The results are unpredictable!

    Is there any way to sync/serialize file-access between pl/i threads in a z/OS batch environment without modifications of the affected module? (like LE-Parameter or something else)

     

    Greetings from Linz!

    xchg00


  • 2.  Re: Multithreading with file handling

    Posted Mon August 01, 2016 07:19 AM

    Won't the reads be executed in the order in which the procedures are called?

     

    And as the code is old, might it be useful to forget ATTACHing

    and make the whole a single compilation unit?

    Memories are much larger now.

    Robin400