我手心里的宝 发表于 2013-4-7 11:03 可以呀,加点注释,要不看起来费劲 还有答题要注意啊三点 1.把思路写上去
我手心里的宝 发表于 2013-4-7 12:55 这个就可以理解为消费者与生产者的例子 需要同步,不建议使用join方法 思路:设计两个线程
许兵兵 发表于 2013-4-7 17:20 这个为什么需要同步?可能我对这个思路不是很理解.能否详细解释下,因为我觉得,如果没有盐,那做饭的线程应 ...
HM朱俊 发表于 2013-4-7 19:29 我同意上面的用2个线程来实现,做饭没盐了去买盐,继续做饭,又没盐了又去买盐。这就跟生产者消费者一样。 ...
李大伟 发表于 2013-4-7 21:31 我觉得这个可以理解成两个 单线程的 生产者 消费者,妈妈做饭没有盐,唤醒儿子线程去买盐,妈妈等待,儿子 ...