View previous topic :: View next topic
|
Author |
Message |
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Hi all,
I have a small doubt in subroutines concept. Assume that, I have three programs (Main programs) named PGM1, PGM2 and PGM3. These three Main programs are calling one subprogram (SUBPGM) at a time?what will be happened in this case? Please let me know the same? |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
my doudt..is
How come all the three programs call the same subprogram at the same time.
Husna, It is logically impossible.
Execution takes place in a single process step by step.
When your main program...for suppose/...calls PGM2, the control moves from main to PGM2. Now main program don't execute ...but waits untill it receives hte control back from PGM2.
At no point.....all three programs don't execute.
There is no TREADING concept in cobol as of JAVA.
clear??
~Vamsi |
|
Back to top |
|
|
rocksolid
New User
Joined: 29 Aug 2006 Posts: 21 Location: India
|
|
|
|
Hi Vamsi...
I think Husna's question is different.
PGM1, PGM2 and PGM3 are 3 different MAIN programs and they are not calling one another.
These 3 diff programs are calling one sub program at the same time. This is very usual scenario in real time.
whenever MAIN PGM calls, it will get the copy of SUB PGM'S object module only. In this way any number of MAIN PGMS can call this SUB PGM at the same time.
Husna.. is this what u expect?
Corrections welcomed....
Thank you, |
|
Back to top |
|
|
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Hi,
It's clear now... Thanks a lot. |
|
Back to top |
|
|
|