[Mono-devel-list] Processes in Mono

Michi Henning michi at zeroc.com
Thu Jul 29 19:42:52 EDT 2004


Colt Majkrzak wrote:

> Hello, im trying to write a program that checks if the pid exists or not. 
> The code works great in windows with MS's framework, but for some reason
> under mono in linux im getting:
>  
> Unhandled Exception: System.ArgumentException: Can't find process with ID
> 21245
> in <0x0005e> System.Diagnostics.Process:GetProcessById (int)
> in <0x00172> StatusServer.statusserver:shoutcaststatus (string)
> in <0x0010c> StatusServer.MainS:Main (string[])
>  
>  
> # ps 21245
>   PID TTY      STAT   TIME
> 21245 ?        SN     0:08
>  
> I believe this also relates to why I cannot kill a pid from within mono
> under linux.  Please help!

That's interesting. I have a problem that might be related.

I'm calling System.Diagnostics.Process.GetCurrentProcess().Kill().
With Windows, that code kills the server as expected.
Under Linux (dual-CPU) machine, called from within a multi-threaded
server, the Kill() call won't kill the process.

Cheers,

Michi.




More information about the Mono-devel-list mailing list