View previous topic :: View next topic
|
Author |
Message |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
Hi,
Is there any way to make the cobol code just sleep for some time and then wake up after the specified time just like we have fgets in c.
I need to know this because I have to make the main cobol code thread to sleep for say 20 seconds and then wake up so that the initiated child thread finishes its work and gives the data back to main thread.
Thanks in advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
COBOL does not have a "sleep" statement.
If you "call" what you refer to the "child thread", the calling module will "wait" until the called code completes.
Why will this not work for you? |
|
Back to top |
|
|
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
The child thread is not locking it due to some reason.I have not got any errors as such. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The child thread is not locking it due to some reason.I have not got any errors as such. |
Please clarify this.
What do you expect to be "locked"?
When an executing program calls "some code" the calling code automatically stops executing - there is no locking. When the called module returns control to the caller (goback) the caller proceeds from the instructon after the call.
If your called module isues a STOP RUN, your process will simply terminate and return to the caller will not happen. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I wonder why You want to write a RYO multitasking application in COBOL ??
the usual approach in multitasking
is to define an ECB and have the mother task wait on it
when the child/daughter process ends it should post the ECB
and the mother task will be waked from the wait...
no sleep function needed
just a good understanding of mvs/zos multitasking tecniques
but... for plain cobol when You call a function/subroutine the process is syncronous with the calling process
and the calling process will be continue when the called program returns |
|
Back to top |
|
|
|