Difference between revisions of "Thread"

From Chessprogramming wiki
Jump to: navigation, search
 
(17 intermediate revisions by the same user not shown)
Line 55: Line 55:
 
==2010 ...==
 
==2010 ...==
 
* [http://www.talkchess.com/forum/viewtopic.php?t=33705 Stockfish-1.7.0 Hyper-threading Detection] by [[Louis Zulli]], [[CCC]], April 09, 2010
 
* [http://www.talkchess.com/forum/viewtopic.php?t=33705 Stockfish-1.7.0 Hyper-threading Detection] by [[Louis Zulli]], [[CCC]], April 09, 2010
 +
* [http://www.talkchess.com/forum/viewtopic.php?t=36103 Hyperthreading] by [[Gerd Isenberg]], [[CCC]], September 17, 2010
 
* [http://www.talkchess.com/forum/viewtopic.php?t=36465 To hyperthread or not to hyperthread (Crafty tested)] by [[Martin Thoresen]], [[CCC]], October 24, 2010 » [[Crafty]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=36465 To hyperthread or not to hyperthread (Crafty tested)] by [[Martin Thoresen]], [[CCC]], October 24, 2010 » [[Crafty]]
* [http://www.talkchess.com/forum/viewtopic.php?t=36103 Hyperthreading] by [[Gerd Isenberg]], [[CCC]], September 17, 2010
+
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=36637 Input / ThinkingThreads] by [[Richard Allbert]], [[CCC]], November 08, 2010
 
* [http://www.talkchess.com/forum/viewtopic.php?t=36966 Thread management / organization in parallel processing?] by [[Pham Hong Nguyen|Nguyen Pham]], [[CCC]], December 06, 2010
 
* [http://www.talkchess.com/forum/viewtopic.php?t=36966 Thread management / organization in parallel processing?] by [[Pham Hong Nguyen|Nguyen Pham]], [[CCC]], December 06, 2010
 
'''2011'''
 
'''2011'''
Line 64: Line 65:
 
* [http://www.talkchess.com/forum/viewtopic.php?t=44658 hyper threading and move generation] by [[Gabor Buella]], [[CCC]], August 01, 2012 » [[Move Generation]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=44658 hyper threading and move generation] by [[Gabor Buella]], [[CCC]], August 01, 2012 » [[Move Generation]]
 
'''2013'''
 
'''2013'''
* [http://www.open-chess.org/viewtopic.php?f=5&t=2262 Multi-threaded memory access] by [[Vadim Demichev|ThinkingALot]], [[Computer Chess Forums|OpenChess Forum]], February 10, 2013 » [[Memory]], [[Shared Hash Table]]
+
* [http://www.open-chess.org/viewtopic.php?f=5&t=2262 Multi-threaded memory access] by [[ThinkingALot]], [[Computer Chess Forums|OpenChess Forum]], February 10, 2013 » [[Memory]], [[Shared Hash Table]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=47757 Hyperthreading and Computer Chess: Intel i5-3210M] by [[Michael Scheidl|Mike Scheidl]], [[CCC]], April 12, 2013
 
* [http://www.talkchess.com/forum/viewtopic.php?t=47757 Hyperthreading and Computer Chess: Intel i5-3210M] by [[Michael Scheidl|Mike Scheidl]], [[CCC]], April 12, 2013
 
* [http://www.talkchess.com/forum/viewtopic.php?t=47820 Implementation of multithreaded search in Jazz] by [[Evert Glebbeek]], [[CCC]], April 20, 2013 » [[Parallel Search]], [[Jazz]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=47820 Implementation of multithreaded search in Jazz] by [[Evert Glebbeek]], [[CCC]], April 20, 2013 » [[Parallel Search]], [[Jazz]]
Line 91: Line 92:
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56113 A cautionary tale on thread safety] by [[Steven Edwards]], [[CCC]], April 25, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56113 A cautionary tale on thread safety] by [[Steven Edwards]], [[CCC]], April 25, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56327 A Nice routine] by [[Steven Edwards]], [[CCC]], May 12, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56327 A Nice routine] by [[Steven Edwards]], [[CCC]], May 12, 2015
 +
* [https://stackoverflow.com/questions/30330013/does-hyperthreading-have-trouble-with-avx Does Hyperthreading have trouble with AVX?] by cmylin, [https://en.wikipedia.org/wiki/Stack_Overflow Stack Overflow], May 19, 2015 »  [[AVX]], [[AVX2]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56523 Deep split perft()] by [[Steven Edwards]], [[CCC]], May 29, 2015 » [[Perft]], [[Symbolic]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56523 Deep split perft()] by [[Steven Edwards]], [[CCC]], May 29, 2015 » [[Perft]], [[Symbolic]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56858 thread affinity] by [[Martin Sedlak]], [[CCC]], July 03, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56858 thread affinity] by [[Martin Sedlak]], [[CCC]], July 03, 2015
Line 106: Line 108:
 
* [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
 +
'''2018'''
 
* [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=67932 Stockfish and serious hardware: 384 threads] by [[Jouni Uski]], [[CCC]], July 08, 2018 » [[Stockfish]]
 +
'''2019'''
 +
* [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
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=70586 Prefetch and Threading] by [[Dennis Sceviour]], [[CCC]], April 25, 2019 » [[Memory]], [[Transposition Table]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=70919 strategies for finding slowdows in lazy smp] by [[Folkert van Heusden]], [[CCC]], June 04, 2019 » [[Lazy SMP]], [[Nodes per Second]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=71739 Multithreaded noob question] by [[Michael Sherwin]], [[CCC]], September 06, 2019
 +
==2020 ...==
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74705 What happens with my hyperthreading?] by [[Kai Laskos]], [[CCC]], August 06, 2020 » [[Stockfish NNUE]], [[NNUE]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75088 SMP, first shot at implementation] by [[Chris Whittington]], [[CCC]], September 12, 2020 » [[Lazy SMP]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75116 Memory management and threads] by [[Chris Whittington]], [[CCC]], September 15, 2020 » [[Memory]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75151 Very Lazy SMP and worker threads] by [[Chris Whittington]], [[CCC]], September 18, 2020 » [[Lazy SMP]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=76190 Dispelling the Myth of NNUE with LazySMP: An Analysis] by [[Andrew Grant]], [[CCC]], December 30, 2020 » [[NNUE]], [[Lazy SMP]]
 +
'''2021'''
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77088 Missing input in ponder] by [[Fabio Gobbato]], [[CCC]], April 15, 2021 » [[UCI]], [[Pondering]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77142 Thread overhead in C++] by [[Toni Helminen|JohnWoe]], [[CCC]], April 21, 2021
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77189 Listening for GUI input when searching] by [[Niels Abildskov]], [[CCC]], April 27, 2021 » [[GUI]], [[Search]], [[UCI]]
 +
* [https://www.talkchess.com/forum3/viewtopic.php?f=2&t=78548 Single core?] by [[Gabor Szots]], [[CCC]], October 30, 2021
 +
'''2022'''
 +
* [https://www.talkchess.com/forum3/viewtopic.php?f=7&t=79588 Stockfish search] by Werewolf, [[CCC]], March 26, 2022 » [[Lazy SMP]], [[Stockfish]]
  
 
=External Links=  
 
=External Links=  
Line 123: Line 147:
 
* [http://www.dmoz.org/Computers/Programming/Threads/ Open Directory - Computers: Programming: Threads]
 
* [http://www.dmoz.org/Computers/Programming/Threads/ Open Directory - Computers: Programming: Threads]
 
* [https://en.wikipedia.org/wiki/Thread Thread (disambiguation page) from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Thread Thread (disambiguation page) from Wikipedia]
 +
* [[:Category:Phish|Phish]] - Thread, [https://en.wikipedia.org/wiki/Sigma_Oasis Sigma Oasis] (2020),[https://en.wikipedia.org/wiki/YouTube YouTube] Video
 +
: {{#evu:https://www.youtube.com/watch?v=JzosgX-2Al8|alignment=left|valignment=top}}
 
==Multithreading==  
 
==Multithreading==  
 
* [https://en.wikipedia.org/wiki/Multithreading_%28computer_architecture%29 Multithreading from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Multithreading_%28computer_architecture%29 Multithreading from Wikipedia]
Line 161: Line 187:
 
=References=  
 
=References=  
 
<references />
 
<references />
 
 
'''[[Programming|Up one Level]]'''
 
'''[[Programming|Up one Level]]'''
 +
[[Category:Phish]]

Latest revision as of 20:14, 28 March 2022

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

2018

2019

Re: Hyperthreading on or off by Andrew Grant, CCC, January 20, 2019

2020 ...

2021

2022

External Links

Thread

Multithreading

Posix

Windows

Creating Threads

C++

Java

GPU

References

Up one Level