Why is creating a new process more expensive on Windows than Linux?

后端 未结 10 702
情深已故
情深已故 2020-11-27 11:35

I\'ve heard that creating a new process on a Windows box is more expensive than on Linux. Is this true? Can somebody explain the technical reasons for why it\'s more expen

10条回答
  •  Happy的楠姐
    2020-11-27 12:18

    The short answer is "software layers and components".

    The windows SW architecture has a couple of additional layers and components that don't exist on Unix or are simplified and handled inside the kernel on Unix.

    On Unix, fork and exec are direct calls to the kernel.

    On Windows, the kernel API is not used directly, there is win32 and certain other components on top of it, so process creation must go through extra layers and then the new process must start up or connect to those layers and components.

    For quite some time researchers and corporations have attempted to break up Unix in a vaguely similar way, usually basing their experiments on the Mach kernel; a well-known example is OS X.. Every time they try, though, it gets so slow they end up at least partially merging the pieces back into the kernel either permanently or for production shipments.

提交回复
热议问题