Pool& p = *new SinglyLinkedPool (8192); Pool& q = *new (p) SinglyLinkedPool (1024, p);creates two pools, p and q. Pool q is allocated in storage acquired from p.
Modify the simulation shown in Program as follows: In each cycle acquire either four bytes or 32 bytes. Use a suitable random number generator (see Section ) so that the smaller block is acquired 75% of the time.
In addition, suppose that the number of cycles that a block is in use is an exponentially distributed random variable. Assume that the smaller blocks are held on average for 10 cycles and that the larger blocks are held on average for 100 cycles.
Use the modified simulation program to compare the various storage pool implementations given in this chapter.