Re: spawn functions?





--- On Fri, 4/13/12, haratron <haratron gmail com> wrote:

From: haratron <haratron gmail com>
Subject: Re: spawn functions?
To: "Sergei Steshenko" <sergstesh yahoo com>
Cc: gtk-perl-list gnome org
Date: Friday, April 13, 2012, 9:38 AM
What do you mean by shared memory?
Can you give a code example?

On Thu, Apr 12, 2012 at 10:48 PM, Sergei Steshenko <sergstesh yahoo com>
wrote:


--- On Thu, 4/12/12, haratron <haratron gmail com>
wrote:

From: haratron <haratron gmail com>
Subject: spawn functions?
To: gtk-perl-list gnome org
Date: Thursday, April 12, 2012, 11:46 AM
Hello,

it seems that the spawn* functions of Gtk have not
been
ported to gtk2-perl.
I have this problem where I need to launch an
external
process from a
button's click callback. It's a TTS (text to
speech)
application that
has play, pause and stop buttons. The actual speech
is been
done by a
python script that I need to execute (don't ask..).
The GUI
in
gtk-perl shouldn't block, so that I am able to e.g.
press
pause/stop
while the voice speaks. I've tried a lot of ways
but it
always ends up
to one of the following:
- GUI gets blocked and I can't press pause/stop
buttons
- GUI doesn't block (usually when I'm forking from
within
the
callback) but once the python script is done
speaking, the
gtk-perl
GUI is closed as well. I read this is a problem of
gtk and
there are
the spawn* functions to compensate for that.

How can I do this?
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


I do this using shared memory.

My gtk+ Perl script sets a flag in shared memory that
new data is available (after making it available) and the
consumer process monitors the flag and grabs the new data
when it sees the set flag.

There is also an acknowledge mechanism, i.e. the IPC is
bidirectional.

Regards,
 Sergei.


I won't give a code example because it's a proprietery project.

Regarding "What do you mean by shared memory?" - for example, Yahoo web search in response to

Linux shared memory

search terms yields, among others, the following matches:

http://fscked.org/writings/SHM/shm.html
http://en.wikipedia.org/wiki/Shared_memory
http://www.cs.cf.ac.uk/Dave/C/node27.html
.

Try to enter

shared memory

into search.cpan.org .

My routines are actually written in "C" and are linked to my Perl script using "Inline::C" module, but one 
can access shared memory from Perl directly.

Regards,
  Sergei.

P.S. An acquaintance   of mine, a CTO, typically does _not_ ask "what is FOO", he rather asks "what are the 
search terms to to learn about FOO".



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