Hi all,
I sent this to Axel a little while ago but realised this list is
probably a better destination for it.
------------------
Hi Axel,
Firstly, fish rocks :)
I started using fish a few months ago when a friend at a RailsCamp
showed it to me, and since then I've got a few mates using it. We've
all had an issue where sometimes a command stalls for a few seconds
before the prompt returns. There's no CPU or disc activity, just a
delay.
It's sometimes an explicitly run command, and sometimes just happens
when hitting enter—i.e. one of the commands that run within
fish_prompt().
I did some investigating, turning on debugging output, and I found
that the select() call in select_try() was taking 5 seconds to return.
When it returns, the loop in job_continue() from which select_try() is
called immediately re-calls it, and it generally returns immediately
the second time.
I don't really understand how select() works, but it seems that if the
subcommand doesn't have output (or EOF) available at the point that
select is called, then it will never return before the 5sec timeout.
My
patch:http://github.com/benhoskings/fish/commit/b064d8c6916b54688103d0d8df63a3aed0aca75e
(http://github.com/benhoskings/fish is a direct import of your darcs
repo using darcs-to-git.)
I changed the timeout to 10 milliseconds, and it solved the problem
completely. select_try() polls repeatedly until the command finishes
or has output ready, and the prompt delay has disappeared for all of
us. The 10msec delay is still long enough that fish doesn't use any
CPU during the loop.
I'm interested to see what you think of this patch, because although
it's completely fixed the problem for us, there might be a more
"correct" way to solve it.
Cheers
Ben Hoskings
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users