Questions about os.waitpid(pid, options) on windows

F

Fan

It seems that waitpid take process handle instead of process id as the
first parameter on Windows. On Unices platform, the first parameter
is process id.

This interface is a little bit confusing. What's the purpose for such
a design?

Thanks a lot,
Fan
 
C

Christopher Head

It seems that waitpid take process handle instead of process id as the
first parameter on Windows. On Unices platform, the first parameter
is process id.

This interface is a little bit confusing. What's the purpose for such
a design?

Thanks a lot,
Fan

I would assume it's because that's how the underlying OS primitives
work. Under Windows, concepts of "process ID" and "process handle" both
exist (and are separate), and the functions that wait for events to
occur (WaitForSingleObject, WaitForMultipleObjects, and so on) take
handles of various sorts, including process handles. Under Linux, there
is no such thing as a process handle, only a process ID, and waitpid
(the system call) takes a process ID.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top