Computer Chess Club Archives


Search

Terms

Messages

Subject: MT search programming questions

Author: Daniel Shawul

Date: 04:50:29 11/17/04


I have some programming difficulties on multi threaded search.

One problem is that allocating memory in search is a problem

search(alpha,beta,...)
{
   SPLIT* p_split;
   p_split = new SPLIT;

   if(search in parallel)
      searchInparallel(...)
   else
      search()

   delete p_split;   //here it crashes
}

The error message says "you can only delete memory from *local* heap".
Do threads have their own heap memory?
When i change in to using a split object than using a pointer it works fine.
but i am thinking this is slower than allocating memory when only i need to
split search. what do you suggest?

Another question is do i need to lock/unlock common data for threads
which is a read only type?

Do you block the main(parent) thread when search is split? i have read ('m not
sure though) this may cause a problem but it seems to work fine for me.

thanks in advance
daniel







This page took 0.02 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.