pl1 mutli threading



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

pl1 mutli threading

Postby rama_krishna » Fri Jun 30, 2017 3:20 am

Hi,

Does any one used multi threading in pl1 along with embedded SQL. I am able to run plain pl1 program with POSIX on option in multi threading mode. however when I embed some sql statements
the program abend with protection exception. Does any one have idea how to run pl1 db2 program using multi threading?

Thanks
rama_krishna
 
Posts: 3
Joined: Thu Jun 29, 2017 6:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: pl1 mutli threading

Postby enrico-sorichetti » Fri Jun 30, 2017 11:05 am

what do You expect to gain by using multithreading ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: pl1 mutli threading

Postby NicC » Fri Jun 30, 2017 1:55 pm

As you have not provided any detail we do not know that the cause of the error is anything to do with the addition of SQL to the program. It could e a long-existing error which has now come to light or it could be bad coding or bad design (using data from one thread in another thread before the first has completed) or a multitude of other things.

How about temporarily removing the multi-threading and see if you still get the error or not.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: pl1 mutli threading

Postby rama_krishna » Fri Jun 30, 2017 6:46 pm

Yes, I tried to execute the program without multi threading and the program ran fine.
but when i call the subprogram TSTTH1 using attach , it fails with protection exception at db statements. I used POSIX ON while running the program.
ATTACH TSTTH1 () tHREAD(T1);

Exception details:
IBM0534S ONCODE=8094 Protection exception
From entry point TSTTH1 at statement 2 at compile unit offset -0002C3
2CD2FD22.
rama_krishna
 
Posts: 3
Joined: Thu Jun 29, 2017 6:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: pl1 mutli threading

Postby Robert Sample » Fri Jun 30, 2017 7:06 pm

Have you tried the ATTACH with only a PL/I statement (like PUT) in the subprogram? If you try it and it works, then the issue is with the db (sic) statements in your subprogram. If you try it and it doesn't work, then you have problems with your ATTACH.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: pl1 mutli threading

Postby rama_krishna » Fri Jun 30, 2017 7:30 pm

I tried without DB statements and it works perfectly in multi threading. But it fails at first exec sql when i run through ATTACH.
I dont see any issue with db2 statements as the db2 statements run fine when I run the program without ATTACH as a normal subprogram call.

Not sure if anything i need to specify in BIND when I run the db2 program using threading or some other parameter or which configuration is missing.
rama_krishna
 
Posts: 3
Joined: Thu Jun 29, 2017 6:08 pm
Has thanked: 0 time
Been thanked: 0 time


Return to PL/I