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.
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.
Table of Contents
See also
Publications
1994 ...
2000 ...
2010 ...
Forum Posts
1999
2000 ...
2005 ...
2010 ...
- Stockfish-1.7.0 Hyper-threading Detection by Louis Zulli, CCC, April 09, 2010
- To hyperthread or not to hyperthread (Crafty tested) by Martin Thoresen, CCC, October 24, 2010 » Crafty
- Hyperthreading by Gerd Isenberg, CCC, September 17, 2010
- Thread management / organization in parallel processing? by Nguyen Pham, CCC, December 06, 2010
2011- Have Crafty's threads never gone to sleep? by Nguyen Pham, CCC, January 31, 2011
- On parallelization by Onno Garms, CCC, March 13, 2011
2012- hyper threading and move generation by Gabor Buella, CCC, August 01, 2012 » Move Generation
2013- Multi-threaded memory access by ThinkingALot, OpenChess Forum, February 10, 2013 » Memory, Shared Hash Table
- Hyperthreading and Computer Chess: Intel i5-3210M by Mike Scheidl, CCC, April 12, 2013
- Implementation of multithreaded search in Jazz by Evert Glebbeek, CCC, April 20, 2013 » Parallel Search, Jazz
- use sleeping threads by Don Dailey, CCC, July 10, 2013 » Stockfish
- C++ Question by Ted Wong, CCC, July 30, 2013 » C++
- Writing to a Text File (Thread Safe) by Steve Maughan, CCC, August 10, 2013 » Logging
- SMP and Thread Pool Design pattern by Edsel Apostol, CCC, October 02, 2013
- Multithreaded LRU by Alvaro Cardoso, CCC, October 06, 2013 » Memory, Endgame Tablebases
20142015 ...
- Stockfish with 16 threads - big news? by Louis Zulli, CCC, February 15, 2015
- Thread count limits and core counts by Steven Edwards, CCC, March 22, 2015
- Thread synchronization questions for experts by Steven Edwards, CCC, April 21, 2015 » Symbolic
- A cautionary tale on thread safety by Steven Edwards, CCC, April 25, 2015
- A Nice routine by Steven Edwards, CCC, May 12, 2015
- Deep split perft() by Steven Edwards, CCC, May 29, 2015 » Perft, Symbolic
- thread affinity by Martin Sedlak, CCC, July 03, 2015
- Stockfish now benefits from hyperthreading by Dmitri Gusev, CCC, November 12, 2015 » Stockfish
2016Explanation for non-expert? by Louis Zulli, CCC, February 16, 2015 » Stockfish
Re: Baffling multithreading scaling behavior by Robert Hyatt, CCC, September 07, 2016
Re: Lazy SMP >4 Thread Slowdown by Ronald de Man, CCC, November 29, 2017
External Links
Thread
Multithreading
Posix
Windows
Creating Threads
C++
Java
GPU
References
What links here?
Up one Level