Re: Can shared memory data be used as a signal like gtk-input-add does with a pipe?



Am Donnerstag, den 27. September 2001 17:04:39 schrieb Marco Quezada:
"Norris, Kendall P." wrote:

I am writing an application with a gtk process for user interface and a
seperate process for my test application.  I was using pipes for
communication between the processes but am now using shared memory as my
IPC.  I used gdk-input-add to emit a signal when the pipe had a message.  Is
there a way I can use a variable in the shared memory space,  monitor the
memory address with gtk looking for a change of state and cause a signal to
be emitted?

I'm not sure if this is the best and or only way to do it but I just have a
timeout that runs at a certain rate (10 Hz in my case) and looks at the value
of the variable in memory, if the value changes then it goes in and does
whatever processing it needs to do.

Maybe you should use signals [signal(2)] to inform the process, this
way it can be done without polling.

        MfG
        bmg

-- 
"Des is völlig wurscht, was heut beschlos- | M G Berberich
 sen wird: I bin sowieso dagegn!"          | berberic fmi uni-passau de
(SPD-Stadtrat Kurt Schindler; Regensburg)  | www.fmi.uni-passau.de/~berberic

Attachment: pgp1FbtlbMXhX.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]