Difference between revisions of "Thread"

From Chessprogramming wiki
Jump to: navigation, search
Line 106: Line 106:
 
* [http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=31863 Hyperthreading debate reopened?] by Zat, [[Computer Chess Forums|Rybka Forum]], December 03, 2016
 
* [http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=31863 Hyperthreading debate reopened?] by Zat, [[Computer Chess Forums|Rybka Forum]], December 03, 2016
 
* [http://www.talkchess.com/forum/viewtopic.php?t=62622 Diminishing returns and hyperthreading] by [[Kai Laskos]], [[CCC]], December 27, 2016 » [[Depth#DiminishingReturns|Diminishing Returns]], [[Match Statistics]], [[Playing Strength]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=62622 Diminishing returns and hyperthreading] by [[Kai Laskos]], [[CCC]], December 27, 2016 » [[Depth#DiminishingReturns|Diminishing Returns]], [[Match Statistics]], [[Playing Strength]]
 +
'''2017 ...'''
 
* [http://www.talkchess.com/forum/viewtopic.php?t=64441 Core behaviour] by [[Ed Schroder]], [[CCC]], June 28, 2017 » [[Engine Testing]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=64441 Core behaviour] by [[Ed Schroder]], [[CCC]], June 28, 2017 » [[Engine Testing]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=65844 Lazy SMP >4 Thread Slowdown] by [[Can Cetin]], [[CCC]], November 29, 2017 » [[Lazy SMP]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=65844 Lazy SMP >4 Thread Slowdown] by [[Can Cetin]], [[CCC]], November 29, 2017 » [[Lazy SMP]]
 
: [http://www.talkchess.com/forum/viewtopic.php?t=65844&start=4 Re: Lazy SMP >4 Thread Slowdown] by [[Ronald de Man]], [[CCC]], November 29, 2017
 
: [http://www.talkchess.com/forum/viewtopic.php?t=65844&start=4 Re: Lazy SMP >4 Thread Slowdown] by [[Ronald de Man]], [[CCC]], November 29, 2017
 
* [http://www.talkchess.com/forum/viewtopic.php?t=67186 More questions about threads] by [[Patrice Duhamel]], [[CCC]], April 21, 2018 » [[Young Brothers Wait Concept]]  
 
* [http://www.talkchess.com/forum/viewtopic.php?t=67186 More questions about threads] by [[Patrice Duhamel]], [[CCC]], April 21, 2018 » [[Young Brothers Wait Concept]]  
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=69658 Hyperthreading on or off] by lovetb, [[CCC]], January 20, 2019
 +
: [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=69658&start=5 Re: Hyperthreading on or off] by [[Andrew Grant]], [[CCC]], January 20, 2019
  
 
=External Links=  
 
=External Links=  

Revision as of 22:03, 20 January 2019

Home * Programming * Thread

Two threads on a single processor [1]

A Thread is the smallest unit of processing that can be scheduled by an operating system. One or multiple threads can exist within the same process to share its resources such as memory. Modern operating systems support both time-sliced and multiprocessor threading within a process scheduler. Some operating systems such as Windows distinguish worker threads from GUI-threads, which incorporate a message loop, able to receive messages from worker threads. Threads share global data of the process, but use disjoint stacks for local variables.

Chess programs using threads for a parallel search have to deal with synchronization issues, if multiple threads read and write none atomic global data simultaneously, requiring multiple read and/or write cycles. A good step to make a program thread safe, is to avoid global variables and to keep board and game states as locals on the stack. To minimize context switching, chess programs often implement a thread pooling pattern along with explicitly or implicitly controlling processor affinity, where the number of threads of the chess program is less or equal to the number of physical processor cores. Threads are further versatile to control standard input inside an engine.

See also

Publications

1994 ...

2000 ...

2010 ...

Forum Posts

1999

2000 ...

2005 ...

2010 ...

2011

2012

2013

2014

2015 ...

Explanation for non-expert? by Louis Zulli, CCC, February 16, 2015 » Stockfish

2016

Re: Baffling multithreading scaling behavior by Robert Hyatt, CCC, September 07, 2016

2017 ...

Re: Lazy SMP >4 Thread Slowdown by Ronald de Man, CCC, November 29, 2017
Re: Hyperthreading on or off by Andrew Grant, CCC, January 20, 2019

External Links

Thread

Multithreading

Posix

Windows

Creating Threads

C++

Java

GPU

References

Up one Level