l***2 发帖数: 486 | 1 1. tree level order traversal
2. number of 1 bits
3. multiple readers, multiple writers
readers can read same time
only one writer can write at the same time
when there is one reader reading, no writing is allowed.
when there is one writer writing, no reading is allowed
4. write a program to occupy 50% CPU
50% time busy, 50% idle | w*********3 发帖数: 28 | | l***2 发帖数: 486 | 3 take a system time,
then do a for loop of 1000 times,
check system time again
then we know how much time 1000 loop will take
and then take more loop if needed to get 1ms of cpu busy,
then sleep 1ms.
【在 w*********3 的大作中提到】 : lz最后一题是个什么思路?
| l***2 发帖数: 486 | 4 take a system time,
then do a for loop of 1000 times,
check system time again
then we know how much time 1000 loop will take
and then take more loop if needed to get 1ms of cpu busy,
then sleep 1ms.
【在 w*********3 的大作中提到】 : lz最后一题是个什么思路?
|
|