我的美洲狮配置:
for (User user : users) { // for each User from users list
for (Item item : user.items) { // check each item chosen by this user
if (fruits.containsKey(item) { // if the fruit is already present in the items HashMap increment the amount of items
int previousNumberOfItems = fruits.get(item);
fruits.put(item, ++previousNumberOfItems);
else { // otherwise put the first occurrency of this item
fruits.put(item, 1);
}
}
}
htop:
线程数应为5,但htop显示每个worker(进程)中有12个线程。顺便说一句,我在一个码头工人的容器中运行工人和htop。
这让我很困惑,有人可以解释一下吗?