Hi all, =
I've been running polyml 5.1 on windows from a C# application as a child pr= ocess, redirecting standard input/output via the startupinfo and am having = a timing performance problem... =
I have found that when sending small SML commands to polyml (that take 10s = of milliseconds to execute) the output only comes back after about 500ms. T= his seems to be because threads in polyml on windows wait for 500ms =
in Processes::ThreadPauseForIO before re-polling for input. Is this correct= , and if so can I get around this? (looking at the source code suggests I m= ay be able to send polyml a message to kick it into action at the appropria= te time?) =
regards, Richard Harrison. =
_________________________________________________________________ Be a Hero and Win with Iron Man http://clk.atdmt.com/UKM/go/msnnkmgl0010000009ukm/direct/01/-------------- = next part -------------- An HTML attachment was scrubbed... URL: http://lists.inf.ed.ac.uk/mailman/private/polyml/attachments/20080501/= d1d4d5a7/attachment.html
Richard Harrison wrote:
I have found that when sending small SML commands to polyml (that take 10s of milliseconds to execute) the output only comes back after about 500ms. This seems to be because threads in polyml on windows wait for 500ms in Processes::ThreadPauseForIO before re-polling for input. Is this correct, and if so can I get around this? (looking at the source code suggests I may be able to send polyml a message to kick it into action at the appropriate time?)
There was a similar issue with Unix and I've reduced the time-out to 100ms in both Unix and Windows in CVS. You could shorten the time out even more if you wanted to.
It would probably be better for the code to use overlapped IO rather than polling. I didn't do this originally because I wanted to maintain compatibility with Windows 95/98 which didn't support overlapped IO. Maybe it's time to change.
David.
On Mon, 5 May 2008, David Matthews wrote:
Richard Harrison wrote:
I have found that when sending small SML commands to polyml (that take 10s of milliseconds to execute) the output only comes back after about 500ms. This seems to be because threads in polyml on windows wait for 500ms in Processes::ThreadPauseForIO before re-polling for input. Is this correct, and if so can I get around this? (looking at the source code suggests I may be able to send polyml a message to kick it into action at the appropriate time?)
There was a similar issue with Unix and I've reduced the time-out to 100ms in both Unix and Windows in CVS. You could shorten the time out even more if you wanted to.
What happens if this time-out is reduced further, say 10ms or even 1ms?
I've recently came across a situation in Isabelle where the latancy of external system shell invocations becomes a performace problem. There are ways to circumvent the problem by other means in Isabelle itself (which will also speed-up other situations independently of this latency), but maybe it is easier to tweak the Poly/ML parameter again.
Makarius