Page 1 of 1

Threading issue under Polyglot

PostPosted: 18 Sep 2006, 02:29
by Nathan Thom
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

Re: Threading issue under Polyglot

PostPosted: 18 Sep 2006, 12:20
by Richard Allbert
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

Re: Threading issue under Polyglot

PostPosted: 18 Sep 2006, 20:09
by Peter Fendrich
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

Re: Threading issue under Polyglot

PostPosted: 19 Sep 2006, 01:08
by Nathan Thom
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.