多线程实践的示例问题

moo*_*ogs 6 language-agnostic multithreading

我想,我即将解决我认为的难题.我需要多线程化生产者和消费者的管道.

所以我想从小做起.在不同的难度下,哪些练习问题对多线程练习有好处?(而不是你在不专注于并发的书中看到的不切实际的,不切实际的例子).

您会建议哪些书籍或参考文献专注于并发性并提供深入的问题和案例?

(我宁愿把重点放在我想解决这个问题.我只想问了很好的参考和样本的问题.这将是对其他用户更加有用.我不的问题.)

Ram*_*der 5

信号量小书是一本很好的免费书。作者采用了一种独特的方法,即先提出问题,然后在回答之前提出提示。问题的难度逐渐增加,本书不是专门为任何语言编写的,而是涵盖了一般的多线程概念。


Bor*_*vić 3

如果您有足够的时间投入,我会推荐 Jeff Magee 和 Jeff Kramer 所著的《Concurrency: State Models & Java Programs, 2nd Edition》一书,John Wiley&Sons 2006

如果您使用其他语言,则可以忽略 Java 部分

There's a language used to model processes and concurrent processes called FSP. It needs some time and energy to be invested in order to be proficient in the language. There's a tool (LTSA, both are free and supported by an Eclipse plugin or stand alone app) which verifies your models and make you pretty shure that your model is correct from the standpoint of concurrent execution.

Translating this models to your language constructs is then just a question of programming technique and few design patterns.