Get current process ID


#1

Is there a JUCE function to get the current process ID? I had a look at SystemStats and Process but didn’t find anything there.

It should be rather easy to implement using GetCurrentProcessId on Windows and getpid on OS X (and probably Linux) but I thought that it maybe is already available in JUCE or if not, it might be a useful addition.


#2

No.. Don't think I ever added one of those. I guess because it's generally not very useful as a value except in very platform-specific code, where you don't need a cross-platform way of getting it.

It's different from the current thread ID, which is useful in its own right as a unique value to tell threads apart. In a process, you generally don't care what the process ID is because all your code would see the same number.