Once in a while I am asked how many processes can run at any time in a Windows CE system. It is also one of my interview questions when interviewing a candidate with Windows CE experience, and the follow on question is how many threads can run at one time?
Number of Processes:
Then number of processes is controlled by the kernel and was changed for Windows CE 6.0 to be 32K processes. Pretty impressive, but I suspect that the limit is much smaller because on most, if not all, Windows CE systems you will run out of physical memory long before creating even close to 32K processes (I suppose that there is another post topic in that sentence.) Each process has up to 2GB of virtual address space available to it.   As a result, Microsoft lifted the artificial limits on number of processes and virtual address space, now the limit is hardware.
The number of processes that can run at simultaneously in Windows CE 5.0 and earlier versions is 32. Each process has 32MB of virtual address space available to it. The reason for these limits is that the address space for processes is divided into 33 slots each having 32MB of virtual address space available to it. The slots are numbered 0 through 32, with slot 0 being the currently running process.
There was a significant change to the slot architecture in Windows CE 4.0. Slot 1, which was where the kernel ran in prior versions, was reserved for loading DLLs that were specifically fixed up to run in slot 1. The kernel moved out of the slots altogether, so this change didn’t reduce the number of processes that could run. This change was significant because in previous versions all DLLs loaded in slot 0, which meant that the DLLs reduced the amount of available virtual address space available to the running process. That is if any process loaded a DLL, all processes suffered the loss of virtual address space.   This was still true for Windows CE 4.x and 5.0, but only if the DLL was not fixed up to run in slot 1, but most of the DLLs that are loaded are included in the OS and are fixed up to run in slot 1.
Number of Threads
The number of threads is only limited by the available system resources. That is a fancy way of saying that when the system runs out of physical RAM, no more threads can be started.
Number of Processes
Number of Threads
Virtual Address Space per Process
Windows CE 5.0 and before
Limited by System Resources
32 MB
Windows CE 6.0
Limited By System Resources
2 GB
Copyright © 2008 – Bruce Eitman
All Rights Reserved