Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: DBMS Pipe problem

Re: DBMS Pipe problem

From: Billy <vslabs_at_onwe.co.za>
Date: 2 Aug 2005 04:24:29 -0700
Message-ID: <1122981869.372617.9260@g47g2000cwa.googlegroups.com>


Nitin wrote:

> I have some doubts in mind ...Plz give some clarifications
> -->After the timout when we r checking the global variable and any
> message comes on the pipe , will it b lost or will it remain there in
> the pipe .???

It could be lost - depends on the interval between signals. For example, SIGCHLD is send to a process when one of its (forked) children processes terminates. However, should two children terminate within millisecs (or even seconds?) of one another, the kernel will send only a single SIGCHLD to the parent.

Thus signals is at best useful for basic communication and interrupt processing - not suited for anything fine grained. Better to use Unix message queues in that case instead as it is a reliable and robust and scalable IPC method.

> -->If more than one message come in the time when we are checking the
> global variable .. How will the pipe handle them ?? Is there any chance
> that they will be overwritten??

An interrupt does just that. It pushes the current stack, calls the interrupt handler (which means the main thread processing stops dead in its tracks). When the interrupt handler completes, the stack is popped and processing continues in the main thread. Thus main thread processing is paused for the duration of the interrupt. Which is why you do not want to do any expensive work in an interrupt - rather have it set a flag and have the main process detect that a change in processing state is required.

So yes - a single global variable means that it will be overwritten by whatever code writes to it. But as everything is serialised when dealing with an interrupt, only a single piece of code is active and there is no locking or contention issues.

> -->To what value should we set the dbmspipe timeout variable ?? What
> all things should we consider while setting this variable ??

That depends. A small value means more timeouts. That in turn means that the process can more easily/faster respond to an interrupt and can be shutdown in a shorter period of time.

At the same time this smaller time interval means that more machine code is executred per loop iteration which means that it will consume more CPU resources.

If you can wait 10+ seconds for this process to shutdown after sending a SIGUSR1, then set the DMMS_PIPE timeout to 10. If less, set to it to less.

--
Billy
Received on Tue Aug 02 2005 - 06:24:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US