[Gambas-user] process.kill
Benoit Minisini
gambas at ...1...
Tue Jun 7 13:40:08 CEST 2005
On Tuesday 07 June 2005 10:23, Matthias Laur wrote:
> Hi,
> I"ve still a problem with process.kill. I see live video with the mplayer
> from /dev/video32. The mplayer has the parameter -wid and belong to a
> drawing area of a gambas form. So long it works fine. For termination I
> try myprocess.kill. But after then the /dev/video32 is still busy and I
> can"t start the process again. If I use EXEC ["kill", cstr(myprocess.id)]
> it works
> and /dev/video32 is free after then. It works for many times, but
> sometimes the whole application freeze after then and I must close it. I
> don"t understand why, but I think the linux kill is to heavy und not a good
> programming.
>
> 1. Can you tell me the difference between Linux command "kill id" and the
> gambas command process.kill?
The Gambas command Process.Kill is equivalent to "kill -9 pid", but waits for
the process ending. I think the problem is in the second point... It seem
that there is a race condidition in the function that waits for a process
ending (CPROCESS_wait_for). But it should not! :-(
Can you try the last (1.9.9) development version with this patch ? It should
not fix your problems, but may fix the freeze one. Tell me the result :-)
>
> 2. How can I make sure that the device /dev/video32 is free after the
> command process.kill?
If /dev/video32 is not freed, then it means that the process was not killed.
Use the 'fuser' command to know the pid of the process that
uses /dev/video32.
>
> Many thanks for your help
>
> I use Gambas 1.0.6
>
> Regards,
> Matthias
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gbx_c_process.c
Type: text/x-csrc
Size: 14275 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050607/4078c9e3/attachment.c>
More information about the User
mailing list