For Programmers: Free Programming Magazines  


Home > Archive > Cobol > March 2004 > Calling "nice" from MF-COBOL on the UNIX platform









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Calling "nice" from MF-COBOL on the UNIX platform
Chris

2004-03-26, 10:59 pm

Does anyone happen to have a sample of code where you've called the
"nice" function to give the current process a higher priority on the
system? I know it can be done, but am having trouble pinning down the
exact syntax/parameters of the call.

System Information
------------------
OS: HP-UX 11i
COBOL: MF OC 4.2

Thanks in advance for any/all assistance.

Chris
Chris

2004-03-26, 10:59 pm

Stephen,

Thank you. Your post is exactly the information I was looking for.

Chris
Vaclav Snajdr

2004-03-26, 10:59 pm

Xref: kermit comp.lang.cobol:85890

01 PUFF-NICE.
3 NICE-GRUND PIC X(07) VALUE "nice ".
3 NICE-RUN PIC X(65). *> for programname
3 NICE-REST PIC X(42) VALUE
">/dev/null>&2/dev/null& echo $!>".

01 MF-CBID.
3 MF-CB-ZEILE.
5 FILLER PIC X(06) VALUE "sh -c ".
5 FILLER PIC X(01) VALUE X"22". *> "
5 W-CMD-RUN PIC X(99).
5 FILLER PIC X(01) VALUE X"22".
5 MF-CMF-N PIC 99 COMP VALUE 00. *> end

for example you will start a program "stocklist"
in background mode, so you do

move "cobrun stocklist &" to nice-run.
move puff-nice to w-cmd-run.
call "SYSTEM" using mf-cb-zeile.

This is running on HP-UX 10.20 and Linux etc.
Depending on platform the NICE-REST perhaps
NICE-GRUND can be a little different, but it is
no problem to fill it on begin of the whole application
with correct os-depending-values.






Chris wrote:

> Does anyone happen to have a sample of code where you've called the
> "nice" function to give the current process a higher priority on the
> system? I know it can be done, but am having trouble pinning down the
> exact syntax/parameters of the call.
>
> System Information
> ------------------
> OS: HP-UX 11i
> COBOL: MF OC 4.2
>
> Thanks in advance for any/all assistance.
>
> Chris


--
Vaclav Snajdr
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com