Parallel search and access to disk

Discussion about development of draughts in the time of computer and Internet.
Post Reply
TAILLE
Posts: 968
Joined: Thu Apr 26, 2007 18:51
Location: FRANCE

Parallel search and access to disk

Post by TAILLE » Sat Feb 02, 2008 15:35

Ed,
The access to the disk data base is a very interesting problem.
My approach is different; I chose to give access to the disk to only one thread say thead0. The handling of the cache is then quite simple with a lot of advantages.
When a cache miss occurs in thread1 it has of course to ask thread0 to read the disk and you can easily conclude that this cause a loss of time because in this case thread1 has to wait. But, as you say yourself, a miss cache does not occur so frequently, depending of the size of the cache and the size of the endgame database.
As an example my 6 pieces endgame database takes less than 200Mbytes. As a consequence I can put all this database in the cache before the beginning of the game and no miss cache will occur with it.
You mentioned that you have to block the other threads in case a given thread must load a new block from disk. Maybe it is due to the fact that, in your implementation, any thread can access to the disk. I have not this problem with my approach. The only case where I have to block the access of the other thread to the database is when the cache is full and I have to remove one a several blocks from the cache.

My parallel search algorithm is not the "younger brothers wait" algorithm but remember that I have only 2 threads so my problem is somewhat different. In my implementation the work given to thread0 and thread1 has to take into account the fact that thread0 has always to be ready to make all the access to the disk. As a consequence I always try to handle to best sequence by thread1.

Gérard

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Post by Ed Gilbert » Sat Feb 02, 2008 20:19

Gerard, I think you are right that it is better to do all the db file reads in a single thread. I will create another thread to do this, separate from the search threads, and when a cache miss occurs the search threads will request data from the file read thread and block until the read thread supplies the data.

-- Ed

Post Reply