Working set can be divided into
code working set and
data working set. This distinction is important when code and data are separate at the relevant level of the memory hierarchy, as if
either working set does not fit in that level of the hierarchy, thrashing will occur. In addition to the code and data themselves, on systems with
virtual memory, the
memory map (of virtual memory to physical memory) entries of the pages of the working set must be cached in the
translation lookaside buffer (TLB) for the process to progress efficiently. This distinction exists because code and data are cached in small blocks (
cache lines), not entire pages, but address lookup is done at the page level. Thus even if the code and data working sets fit into cache, if the working sets are split across many pages, the virtual address working set may not fit into TLB, causing TLB thrashing. Analogs of working set exist for other limited resources, most significantly
processes. If a set of processes requires frequent interaction between multiple processes, then it has a '''''' that must be
coscheduled in order to progress: If the processes are not scheduled simultaneously – for example, if there are two processes but only one core on which to execute them – then the processes can only advance at the rate of one interaction per time slice. Other resources include
file handles or
network sockets – for example, copying one file to another is most simply done with two file handles: one for input, one for output, and thus has a "file handle working set" size of two. If only one file handle is available, copying can still be done, but requires acquiring a file handle for the input, reading from it (say into a buffer), releasing it, then acquiring a file handle for the output, writing to it, releasing it, then acquiring the input file handle again and repeating. Similarly a server may require many sockets, and if it is limited would need to repeatedly release and re-acquire sockets. Rather than thrashing, these resources are typically
required for the program, and if it cannot acquire enough resources, it simply fails. ==See also==