Re: HPUX sleep effect on CPU time slize and thread priority
- From: xbokZero@xxxxxxxxx
- Date: Tue, 20 Nov 2007 18:34:33 -0800 (PST)
On Nov 17, 5:28 am, Rick Jones <rick.jon...@xxxxxx> wrote:
xbokZ...@xxxxxxxxx wrote:
I have several client application that do same processing. The
application is spawn by another application called server. One of
them is recently patched tosleepjust between being fork and spawn.
So the way it is done is in server application, fork to client
threadand serverthread.
A wording nit - fork() creats a child _process_ not athread- calling
it athreadimplies (at least to some) something like POSIX threads.
----------------------------
//server code
pid_t pId = fork();
//Lots of code
if (pId == 0)
{
//The way I understood it, this is the clientthread
usleep(500000L); //Sleep500 milisecond
Out of curiousity, why thesleep?
rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
OK my bad! I really thought client process equal to a new thread.
The sleep function is to delay it a few hundred millisecond so that
some code in the else (parent process) part is executed first. I guess
that hold true if child process is something like a thread.
I got a feeling that I'm not understanding how fork work by assuming
that it create another thread. Please advise me on this.
I'm still curios on the answer to first post question.
Best regards!
.
- Follow-Ups:
- Re: HPUX sleep effect on CPU time slize and thread priority
- From: Rick Jones
- Re: HPUX sleep effect on CPU time slize and thread priority
- References:
- HPUX sleep effect on CPU time slize and thread priority
- From: xbokZero
- Re: HPUX sleep effect on CPU time slize and thread priority
- From: Rick Jones
- HPUX sleep effect on CPU time slize and thread priority
- Prev by Date: Re: OpenSSH on HP-UX 10.20
- Next by Date: Re: Data Protector 6.0 scheduling mysteries
- Previous by thread: Re: HPUX sleep effect on CPU time slize and thread priority
- Next by thread: Re: HPUX sleep effect on CPU time slize and thread priority
- Index(es):
Relevant Pages
|