Threading issue under Polyglot

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Threading issue under Polyglot

Postby Nathan Thom » 18 Sep 2006, 02:29

Hi all,

I have recently redesigned LittleThought to be multithreaded. I use the main thread to wait for I/O (with fgets) and other threads for searching. It seems to work fine under Arena and it works fine for me with Polyglot/Winboard using WinXP, but It doesn't work properly with Polyglot/Winboard using Win2K for Leo in his testing.

What happens is that when Polyglot sends a command, LT doesn't seem to see it for anywhere between 2 and 15 secs afterwards causing it to always lose on time.

I have disabled buffering on stdin and stdout and have looked at other source samples (eg glaurung) and can't see what I'm doing wrong. Has anyone else had this problem and could give me some pointers?

Thanks,
- Nathan
Nathan Thom
 
Posts: 3
Joined: 07 Jun 2006, 12:27
Location: Brisbane, Australia

Re: Threading issue under Polyglot

Postby Richard Allbert » 18 Sep 2006, 12:20

Hi Nathan,

I can't help, but have exactly the same problem.

I also used InBetween to have a look, and somtimes, there is definitely a delay between Polyglot receiving a move from winboard, and sending to the engine - although in pondering games only. It works fine in non-pondering games.

Seeing as so many programs work with Polyglot, it must be a problem with my program, but like you, I'm stuck.

Richard
Richard Allbert
 
Posts: 105
Joined: 27 Sep 2004, 11:56
Location: Aschaffenburg, Germany

Re: Threading issue under Polyglot

Postby Peter Fendrich » 18 Sep 2006, 20:09

Nathan,
If you use InBetween, look for the pair readyok and isready.
I had a problem where my input thread read the command but the next command from polyglot came to fast for me and I missed to buffer the readyok command and it disappear for me.

It was of coz a logical error from my part but if you used my template for a separate input thread you might get the same error.

/Peter
User avatar
Peter Fendrich
 
Posts: 193
Joined: 26 Sep 2004, 20:28
Location: Sweden

Re: Threading issue under Polyglot

Postby Nathan Thom » 19 Sep 2006, 01:08

Peter Fendrich wrote:Nathan,
If you use InBetween, look for the pair readyok and isready.
I had a problem where my input thread read the command but the next command from polyglot came to fast for me and I missed to buffer the readyok command and it disappear for me.

It was of coz a logical error from my part but if you used my template for a separate input thread you might get the same error.

/Peter


I'll try this InBetween program, but not sure if it will show anything as Polyglot works fine for me on my PCs anyway.

The problem is when pondering for me too, all the commands are sent from Polyglot in very quick succession and i dont lose any of them but dont process them for ages after they're sent.

I didn't use any templates for my threads, just did what made sense to me... maybe i should have a look at some other examples.
Nathan Thom
 
Posts: 3
Joined: 07 Jun 2006, 12:27
Location: Brisbane, Australia


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 49 guests