Moderator: Andres Valverde
Olivier Deville wrote:Hello Jim !
There seems to be an issue with pondering.
Winboard debug in your mailbox.
Olivier
/**
input_available():
This function checks during a search if there is input waiting that we need to process.
Created 102206; last modified 102206
**/
BOOL input_available(void)
{
#ifdef ZCT_POSIX
int fd;
fd_set f_s;
struct timeval tv;
if (source)
return FALSE;
fd = fileno(input_stream);
FD_ZERO(&f_s);
FD_SET(fd, &f_s);
tv.tv_sec = 0;
tv.tv_usec = 0;
select(1, &f_s, 0, 0, &tv);
return FD_ISSET(fd, &f_s);
#elif defined(ZCT_WINDOWS)
if (source)
return FALSE;
return 0;
#endif
}
/**
input_available():
This function checks during a search if there is input waiting that we need to process.
Created 102206; last modified 102206
**/
BOOL input_available(void)
{
#ifdef ZCT_POSIX
int fd;
fd_set f_s;
struct timeval tv;
if (source)
return FALSE;
fd = fileno(input_stream);
FD_ZERO(&f_s);
FD_SET(fd, &f_s);
tv.tv_sec = 0;
tv.tv_usec = 0;
select(1, &f_s, 0, 0, &tv);
return FD_ISSET(fd, &f_s);
#elif defined(ZCT_WINDOWS)
if (source)
return FALSE;
// return 0;
/*
From Beowulf, from Olithink
*/
/* If we're running under XBoard then we can't use _kbhit() as the input
* commands are sent to us directly over the internal pipe */
#if defined(FILE_CNT)
if (stdin->_cnt > 0)
return stdin->_cnt;
#endif
if (!init) {
init = 1;
inh = GetStdHandle(STD_INPUT_HANDLE);
pipe = !GetConsoleMode(inh, &dw);
if (!pipe) {
SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT));
FlushConsoleInputBuffer(inh);
}
}
if (pipe) {
if (!PeekNamedPipe(inh, NULL, 0, NULL, &dw, NULL))
return 1;
return dw;
} else {
GetNumberOfConsoleInputEvents(inh, &dw);
return dw <= 1 ? 0 : dw;
}
#endif
}
Jim Ablett wrote:I had some problems compiling the smp version
in native Windows, so I compiled it with Cygwin.
Teemu Pudas wrote:Jim Ablett wrote:I had some problems compiling the smp version
in native Windows, so I compiled it with Cygwin.
No kidding. I've managed to fix some of it: now it doesn't crash, it just keeps spawning processes forever (fork() is failing to make CreateProcess() fail).
/**
smp_cleanup():
Takes care of all process-related stuff at exit, i.e. kill children, destroy shared memory
Created 080606; last modified 082606
**/
void smp_cleanup(void)
{
int x;
if (board.id == 0)
{
for (x = 1; x < process_count; x++)
{
print("Killing process %i(pid=%i)...\n", x, smp_block[x].pid);
ExitProcess(smp_block[x].pid);
}
MSDN wrote:ExitProcess Function
Ends the calling process and all its threads.
Zach Wegner wrote:Hello Jim,
Right now, it's perfectly fine to put up compiles, I'd like it. I did an official release just so that the source is distributed along with everything; now anyone can do whatever they want. The best thing to happen now is for the source to go around, any bugs fixed, and compiled by all of the pros. Don't worry about what I said with the bugfixes, you can just keep them fixed and I'll clean it up later. I don't really have the time now, so as long as it works its fine.
Zach
Return to Winboard and related Topics
Users browsing this forum: No registered users and 9 guests