It has always been a data structure store for synchronous mode. Typical: void Tmyclass :: Onse (TStorage & s) {s << Member1; s << Member2; ......}
Void TMYCLASS :: OnLoad (TStorage & S) {S >> MEMBER1; S >> MEMBER2; ...} If the SAVE is full (time) or s data is insufficient (LOAD), the function will wait Until S available or error exits. The Stack equivalent to the process helps us save the context of the I / O state.
But now I want to go to asynchronous mode I / O, when S "Not available", the thread should interrupt the current operation, save the context of the I / O state, turn other operations. So trouble, you have to save this context. Generally, you want to record the following:
1. Which member is operated. 2. If the member is a normal type, it is to record which one of the types of operations. 2. If the member is a composite type, the same, returned to 1.
Therefore, the results of the context preservation are generally a Stack you have, which is the process of logging this recursive.
In fact, think, why, in order to save the space of dozens of K, such as output, first use the synchronized way to record the data in memory, then record the starting address and length of the memory, put the memory output when asynchronous processing If there is no output, you will write down the starting address and length of the unreported portion, waiting for the next time. However, when the results are large, they still need to work hard, really tragic ...