学习线程编程有哪些好的资源?

时间:2021-03-21 03:04:38

With the rise of multicore CPUs on the desktop, multithreading skills will become a valuable asset for programmers. Can you recommend some good resources (books, tutorials, websites, etc.) for a programmer who is looking to learn about threaded programming?

随着桌面多核CPU的兴起,多线程技能将成为程序员的宝贵资产。您是否可以为希望了解线程编程的程序员推荐一些好的资源(书籍,教程,网站等)?

17 个解决方案

#1


17  

Take a look at Herb Sutter's "The Free Lunch Is Over" and then his series of articles on Effective Concurrency.

看看Herb Sutter的“免费午餐结束”,然后是他关于有效并发的系列文章。

#2


10  

Joseph Albahari wrote a good overview of Threading in C# here:

Joseph Albahari在C#中对Threading进行了很好的概述:

http://www.albahari.com/threading/

#3


6  

I've honestly never read it myself, but Concurrent Programming in Java is a book I've heard recommended by several people.

老实说,我自己从来没有读过它,但是Java中的Concurrent Programming是一本我听过几个人推荐的书。

#5


4  

I write about multithreading and concurrency in C++ on my blog. I'm also writing a book on concurrency in C++: C++ Concurrency in Action.

我在博客上写了关于C ++的多线程和并发性。我还在写一本关于C ++并发性的书:C ++ Concurrency in Action。

#6


2  

I've read (most of) Java Concurrency in Practice by Brian Goetz, which is very good.

我已经阅读了Brian Goetz的(大部分)Java Concurrency in Practice,这非常好。

There is obviously a Java-based theme running through the book (using Java specific implementations of threads, locks etc.), but pretty much all of the principles can be applied to other languages.

显然有一个基于Java的主题贯穿本书(使用线程,锁等的Java特定实现),但几乎所有原则都可以应用于其他语言。

The author's home page contains a list of articles he has written, some of which include threading related stuff. Maybe start there and if you like his style, buy the book.

作者的主页包含他撰写的文章列表,其中一些包括与线程相关的内容。也许从那里开始,如果你喜欢他的风格,买书吧。

#7


2  

For a great guide and reference for concurrency programming in C# (or .NET in general) I'd recommend the MSDN What Every Dev Must Know About Multithreaded Apps article by Vance Morrison on MSDN. It contains a great deal of best-practice information and caveats about multithread development

对于C#(或一般.NET)中的并发编程的一个很好的指导和参考,我推荐MSDN上的Vance Morrison的MSDN每个开发者必须知道的关于多线程应用程序的文章。它包含大量关于多线程开发的最佳实践信息和警告

#8


2  

I maintain a linkblog for concurrency articles, blogs, and projects at:

我维护了一个关于并发文章,博客和项目的链接博客:

http://concurrency.tumblr.com

I usually post a link or two per day on a variety of topics (threads, actors, locking, parallel programming) in a variety of environments (Erlang, Java, Scala, .NET, C++, Ruby, Python, etc).

我通常每天在各种环境(线程,演员,锁定,并行编程)上发布一两个链接(Erlang,Java,Scala,.NET,C ++,Ruby,Python等)。

#9


2  

It's Delphi specific, but no reason why the concept wouldn't apply to any other language!

这是特定于Delphi的,但没有理由说这个概念不适用于任何其他语言!

Multi Threading Tutorial

多线程教程

#10


1  

http://www.cilk.com/multicore-e-book/

That's a nice general overview of the sitution, if you're looking for tuorials and books it might be best to specify a language as a starting point so you can mess around with some code.

这是一个很好的概述,如果你正在寻找图书和书籍,最好指定一种语言作为起点,这样你就可以搞砸一些代码。

#11


1  

The Erlang programming language provides an easy-to-use style of concurrent programming. You may never actually use Erlang, but the concepts are transportable to other languages. You might want to read the book Programming Erlang: Software for a Concurrent World .

Erlang编程语言提供了易于使用的并发编程风格。您可能永远不会使用Erlang,但这些概念可以传输到其他语言。您可能需要阅读“编程Erlang:并发世界的软件”一书。

Fans of functional programming claim that there is no need to learn anything new. Just use a pure functional language, and the compiler or interpreter will automatically parallelize everything. So you might want to learn Haskell, OCaml, or another functional language.

函数式编程的粉丝声称没有必要学习任何新东西。只需使用纯函数语言,编译器或解释器就会自动并行化所有内容。所以你可能想学习Haskell,OCaml或其他功能语言。

#12


1  

I don't know what exactly you are looking for, but if you are doing WindowsForms development the following blog post is worth every minute reading: WinForms UI Thread Invokes: An In-Depth Review of Invoke/BeginInvoke/InvokeRequred

我不知道你究竟在寻找什么,但是如果你正在进行WindowsForms开发,那么下面的博客文章值得每分钟阅读:WinForms UI线程调用:对Invoke / BeginInvoke / InvokeRequred的深入评论

#13


1  

I think Boost.Threads is a great C++ concurrency library to learn, especially if you just want to get started in writing multithreaded applications. The code is very succinct and easy to understand, plus the next C++ standard will likely include a threading library based on Boost.Threads (tutorial: http://www.ddj.com/cpp/184401518)

我认为Boost.Threads是一个很棒的C ++并发库,特别是如果你只想开始编写多线程应用程序的话。代码非常简洁易懂,而下一个C ++标准可能包括基于Boost.Threads的线程库(教程:http://www.ddj.com/cpp/184401518)

#14


1  

If you want to have a go at doing a highly parallel version of a simple task, or see real solutions, you could do worse than look at the wide finder project. Basically it's about how to do parallel regex matching of log files efficiently, but trying to add as little code as possible.

如果你想要做一个简单任务的高度并行版本,或者看到真正的解决方案,你可能会比查看广泛的查找器项目更糟糕。基本上它是关于如何有效地进行日志文件的并行正则表达式匹配,但尝试添加尽可能少的代码。

Participants have submitted solutions in many different languages and the performance results are posted. The original project has now finished and there is now wide finder 2 taking the work on.

参与者提交了许多不同语言的解决方案,并公布了绩效结果。原来的项目现在已经完成,现在有广泛的发现者2开始工作。

CodingHorror has a good introduction to wide finder.

CodingHorror对广泛的查找器有很好的介绍。

#15


1  

For a rich, thorough treatment of the subject, with a good balance between computer science and practice, I recommend The Art of Multiprocessor Programming. A lot of examples are in object-oriented code, i.e. Java, with other languages scattered throughout. It just depends on the topic being covered. What I really love about this book is that it discusses how common algorithms should be implemented in a concurrent design. Of course, there's so much more!

为了对该主题进行丰富,彻底的处理,在计算机科学与实践之间取得良好的平衡,我推荐了多处理器编程的艺术。很多例子都是面向对象的代码,即Java,其他语言遍布各处。这取决于所涉及的主题。我真正喜欢本书的是它讨论了如何在并发设计中实现常见算法。当然,还有更多!

For general concepts and a treatment of pthreads, I really like Programming with POSIX Threads. Being the library and API that it is, it's in C.

对于一般概念和pthreads的处理,我真的很喜欢用POSIX Threads编程。作为它的库和API,它在C中。

For Windows and C# developers, check out Joe Duffy's blog. Joe works on parallel libraries, infrastructure, and programming models in Microsoft's Developer Division. He has a book coming in Nov. 2008 titled Concurrent Programming on Windows (Amazon link).

对于Windows和C#开发人员,请查看Joe Duffy的博客。 Joe致力于Microsoft开发人员部门的并行库,基础架构和编程模型。他有一本书于2008年11月出版,名为“Windows上的Concurrent Programming”(亚马逊链接)。

Also, don't miss the Godfather's blog: Herb Sutter's Sutter's Mill. He has links to all his articles in Dr. Dobb's Journal and more. Click his Concurrency category.

此外,不要错过教父的博客:Herb Sutter的Sutter's Mill。他与Dobb博士期刊中的所有文章都有链接。单击他的并发类别。

#16


1  

CPU manufacturers websites have some interesting content:

CPU制造商网站有一些有趣的内容:

http://developer.amd.com/documentation/articles/Pages/default.aspx#parallel

http://software.intel.com/en-us/multi-core

Also Intel's opensource threading library has some good references:

英特尔的开源线程库也有一些很好的参考:

http://www.threadingbuildingblocks.org/

#17


0  

If you work with C#, the book "C# 2008 and 2005 threaded programming", by Gaston C. Hillar - Packt Publishing - http://www.packtpub.com/beginners-guide-for-C-sharp-2008-and-2005-threaded-programming/book , will help you. Highly recommended for C# programmers, because you can download the code with funny examples that exploit your multicore computer. The book is a nice guide with a lot of code to practice. It tells stories while it explains the most difficult concepts.

如果您使用C#,请参阅“C#2008和2005线程编程”一书,作者:Gaston C. Hillar - Packt Publishing - http://www.packtpub.com/beginners-guide-for-C-sharp-2008-and- 2005-线程编程/书籍,将帮助您。强烈建议C#程序员使用,因为您可以使用有趣的示例下载代码,以利用您的多核计算机。这本书是一个很好的指南,有很多代码可供练习。它讲述了故事,同时解释了最困难的概念。

#1


17  

Take a look at Herb Sutter's "The Free Lunch Is Over" and then his series of articles on Effective Concurrency.

看看Herb Sutter的“免费午餐结束”,然后是他关于有效并发的系列文章。

#2


10  

Joseph Albahari wrote a good overview of Threading in C# here:

Joseph Albahari在C#中对Threading进行了很好的概述:

http://www.albahari.com/threading/

#3


6  

I've honestly never read it myself, but Concurrent Programming in Java is a book I've heard recommended by several people.

老实说,我自己从来没有读过它,但是Java中的Concurrent Programming是一本我听过几个人推荐的书。

#4


#5


4  

I write about multithreading and concurrency in C++ on my blog. I'm also writing a book on concurrency in C++: C++ Concurrency in Action.

我在博客上写了关于C ++的多线程和并发性。我还在写一本关于C ++并发性的书:C ++ Concurrency in Action。

#6


2  

I've read (most of) Java Concurrency in Practice by Brian Goetz, which is very good.

我已经阅读了Brian Goetz的(大部分)Java Concurrency in Practice,这非常好。

There is obviously a Java-based theme running through the book (using Java specific implementations of threads, locks etc.), but pretty much all of the principles can be applied to other languages.

显然有一个基于Java的主题贯穿本书(使用线程,锁等的Java特定实现),但几乎所有原则都可以应用于其他语言。

The author's home page contains a list of articles he has written, some of which include threading related stuff. Maybe start there and if you like his style, buy the book.

作者的主页包含他撰写的文章列表,其中一些包括与线程相关的内容。也许从那里开始,如果你喜欢他的风格,买书吧。

#7


2  

For a great guide and reference for concurrency programming in C# (or .NET in general) I'd recommend the MSDN What Every Dev Must Know About Multithreaded Apps article by Vance Morrison on MSDN. It contains a great deal of best-practice information and caveats about multithread development

对于C#(或一般.NET)中的并发编程的一个很好的指导和参考,我推荐MSDN上的Vance Morrison的MSDN每个开发者必须知道的关于多线程应用程序的文章。它包含大量关于多线程开发的最佳实践信息和警告

#8


2  

I maintain a linkblog for concurrency articles, blogs, and projects at:

我维护了一个关于并发文章,博客和项目的链接博客:

http://concurrency.tumblr.com

I usually post a link or two per day on a variety of topics (threads, actors, locking, parallel programming) in a variety of environments (Erlang, Java, Scala, .NET, C++, Ruby, Python, etc).

我通常每天在各种环境(线程,演员,锁定,并行编程)上发布一两个链接(Erlang,Java,Scala,.NET,C ++,Ruby,Python等)。

#9


2  

It's Delphi specific, but no reason why the concept wouldn't apply to any other language!

这是特定于Delphi的,但没有理由说这个概念不适用于任何其他语言!

Multi Threading Tutorial

多线程教程

#10


1  

http://www.cilk.com/multicore-e-book/

That's a nice general overview of the sitution, if you're looking for tuorials and books it might be best to specify a language as a starting point so you can mess around with some code.

这是一个很好的概述,如果你正在寻找图书和书籍,最好指定一种语言作为起点,这样你就可以搞砸一些代码。

#11


1  

The Erlang programming language provides an easy-to-use style of concurrent programming. You may never actually use Erlang, but the concepts are transportable to other languages. You might want to read the book Programming Erlang: Software for a Concurrent World .

Erlang编程语言提供了易于使用的并发编程风格。您可能永远不会使用Erlang,但这些概念可以传输到其他语言。您可能需要阅读“编程Erlang:并发世界的软件”一书。

Fans of functional programming claim that there is no need to learn anything new. Just use a pure functional language, and the compiler or interpreter will automatically parallelize everything. So you might want to learn Haskell, OCaml, or another functional language.

函数式编程的粉丝声称没有必要学习任何新东西。只需使用纯函数语言,编译器或解释器就会自动并行化所有内容。所以你可能想学习Haskell,OCaml或其他功能语言。

#12


1  

I don't know what exactly you are looking for, but if you are doing WindowsForms development the following blog post is worth every minute reading: WinForms UI Thread Invokes: An In-Depth Review of Invoke/BeginInvoke/InvokeRequred

我不知道你究竟在寻找什么,但是如果你正在进行WindowsForms开发,那么下面的博客文章值得每分钟阅读:WinForms UI线程调用:对Invoke / BeginInvoke / InvokeRequred的深入评论

#13


1  

I think Boost.Threads is a great C++ concurrency library to learn, especially if you just want to get started in writing multithreaded applications. The code is very succinct and easy to understand, plus the next C++ standard will likely include a threading library based on Boost.Threads (tutorial: http://www.ddj.com/cpp/184401518)

我认为Boost.Threads是一个很棒的C ++并发库,特别是如果你只想开始编写多线程应用程序的话。代码非常简洁易懂,而下一个C ++标准可能包括基于Boost.Threads的线程库(教程:http://www.ddj.com/cpp/184401518)

#14


1  

If you want to have a go at doing a highly parallel version of a simple task, or see real solutions, you could do worse than look at the wide finder project. Basically it's about how to do parallel regex matching of log files efficiently, but trying to add as little code as possible.

如果你想要做一个简单任务的高度并行版本,或者看到真正的解决方案,你可能会比查看广泛的查找器项目更糟糕。基本上它是关于如何有效地进行日志文件的并行正则表达式匹配,但尝试添加尽可能少的代码。

Participants have submitted solutions in many different languages and the performance results are posted. The original project has now finished and there is now wide finder 2 taking the work on.

参与者提交了许多不同语言的解决方案,并公布了绩效结果。原来的项目现在已经完成,现在有广泛的发现者2开始工作。

CodingHorror has a good introduction to wide finder.

CodingHorror对广泛的查找器有很好的介绍。

#15


1  

For a rich, thorough treatment of the subject, with a good balance between computer science and practice, I recommend The Art of Multiprocessor Programming. A lot of examples are in object-oriented code, i.e. Java, with other languages scattered throughout. It just depends on the topic being covered. What I really love about this book is that it discusses how common algorithms should be implemented in a concurrent design. Of course, there's so much more!

为了对该主题进行丰富,彻底的处理,在计算机科学与实践之间取得良好的平衡,我推荐了多处理器编程的艺术。很多例子都是面向对象的代码,即Java,其他语言遍布各处。这取决于所涉及的主题。我真正喜欢本书的是它讨论了如何在并发设计中实现常见算法。当然,还有更多!

For general concepts and a treatment of pthreads, I really like Programming with POSIX Threads. Being the library and API that it is, it's in C.

对于一般概念和pthreads的处理,我真的很喜欢用POSIX Threads编程。作为它的库和API,它在C中。

For Windows and C# developers, check out Joe Duffy's blog. Joe works on parallel libraries, infrastructure, and programming models in Microsoft's Developer Division. He has a book coming in Nov. 2008 titled Concurrent Programming on Windows (Amazon link).

对于Windows和C#开发人员,请查看Joe Duffy的博客。 Joe致力于Microsoft开发人员部门的并行库,基础架构和编程模型。他有一本书于2008年11月出版,名为“Windows上的Concurrent Programming”(亚马逊链接)。

Also, don't miss the Godfather's blog: Herb Sutter's Sutter's Mill. He has links to all his articles in Dr. Dobb's Journal and more. Click his Concurrency category.

此外,不要错过教父的博客:Herb Sutter的Sutter's Mill。他与Dobb博士期刊中的所有文章都有链接。单击他的并发类别。

#16


1  

CPU manufacturers websites have some interesting content:

CPU制造商网站有一些有趣的内容:

http://developer.amd.com/documentation/articles/Pages/default.aspx#parallel

http://software.intel.com/en-us/multi-core

Also Intel's opensource threading library has some good references:

英特尔的开源线程库也有一些很好的参考:

http://www.threadingbuildingblocks.org/

#17


0  

If you work with C#, the book "C# 2008 and 2005 threaded programming", by Gaston C. Hillar - Packt Publishing - http://www.packtpub.com/beginners-guide-for-C-sharp-2008-and-2005-threaded-programming/book , will help you. Highly recommended for C# programmers, because you can download the code with funny examples that exploit your multicore computer. The book is a nice guide with a lot of code to practice. It tells stories while it explains the most difficult concepts.

如果您使用C#,请参阅“C#2008和2005线程编程”一书,作者:Gaston C. Hillar - Packt Publishing - http://www.packtpub.com/beginners-guide-for-C-sharp-2008-and- 2005-线程编程/书籍,将帮助您。强烈建议C#程序员使用,因为您可以使用有趣的示例下载代码,以利用您的多核计算机。这本书是一个很好的指南,有很多代码可供练习。它讲述了故事,同时解释了最困难的概念。