Re: Re: Re: Re: how to control a process programmatically

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 2019/11/05 02:48 PM, deloptes wrote:
> Michele Calgaro via trinity-devel wrote:
> 
>> --no-fork is a parameter that can be passed to TDE application to prevent the program to run using fork, so that
>> you can run multiple independent instances of such application. Without that, some applications will check if
>> there is already an existing instance of the same application and switch to it instead of creating a new one.
> 
> Ah and forgot to mention when it forks I get a different PID in the funtion I start it, so this is also unreliable.
> Obviously I need to look how fork works exactly
> 
> 
In brief, fork creates a "duplicate process" but with different memory areas and then you have two processes
continuing from the same point in the code. Usually the code will do different things depending on whether it is the
parent process or the child one.
In details, it is a bit more complex than what I described, but the ultimate idea is as above.

- --no-fork is usually good when you want to attach gdb to debug a problem, since you will not need to worry about
separate forked processes.

According to processIdentifier() documentation, -1 is returned if no process is associated with the TQProcess object
you are using. I think a "ps" or "pidof" is an easier way to go.

Cheers
  Michele

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEjhl1z5vbYB3YbFTiKnW3yore1c8FAl3BiKQACgkQKnW3yore
1c+fgRAA0C9vgJ+yJLYIQ7frD9zJSQHpUbTx4weT0Fg40XFl1iKR8saMd/sxVZjf
X240XenN2yN1wvfQ1gCLuTdaUSD0UmUUwrRlDwraKmFU6hPRwlMEDrkXAbL4g9GY
U3ajjeVDXH/orYfKVYi4aQSbKxpMkx5AgmIjau3fuIsz7TQ1ffp7sxJ2S8o2M7dR
EpJASLFWa0/UE6ruK279RXFXpXrtEk7tcOUxcgNEBQZnF6Sxk5VPzodLfDhryGJb
wlgmKXxep+DlN7HROQC5XzsXmE0FxyLTiNMn8ma2Vc97yUNQd1OARtAiHFxo16gT
m3qVYnNyUT3vmWmzzkr/UVK3Gjdv/8D/1BhawqGZ/bKD2xq0BHYDbI7LJGdKAlOe
6iyGaGxkaCW4qjMhjY0gqF3cVGKW0vZRWpZeIJjTp5askCG03XNJrIey8cHid16g
U017F4HLEct8NKM8oX5UPN60cydliaxhvllE3s9DWclftzK22FuT0IncLAtuFG/z
u6TdA6wfHOK3mnMb6cVJ0+D/Ba8o49CN4YnxSebkh+p26n0oPtrZREXnVuS2BmYb
pBmQbWBvHsyQFwvro4IK9ce8sg796xxytuV08v3MPmoViT9UZu0lkaDDihFQd17w
VS051urXDA924UReqclNcGifu4+1OqZDGItecddmvR5mKQpRa3s=
=Dhol
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: trinity-devel-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: trinity-devel-help@xxxxxxxxxxxxxxxxxxxxxxxxxx
Read list messages on the web archive: http://trinity-devel.pearsoncomputing.net/
Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting




[Index of Archives]     [Trinity Users]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [KDE]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux