unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* RE: Can't interrupt directory_files_internal run fromtimer-event-handler
@ 2005-08-05 12:01 klaus.berndl
  2005-08-05 12:53 ` Juanma Barranquero
  2005-08-09 23:29 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: klaus.berndl @ 2005-08-05 12:01 UTC (permalink / raw)


Klaus Zeitler wrote:
> The following problem occurs with CVS emacs + ECB under Solaris 5.8.
> 
> While ECB performs its stealth update activities, emacs sometimes
> seems to 
> hang for a long time.
> gdb shows the following function and backtrace:
> 
> directory_files_internal (directory=16076323, full=3313665,
>     match=3313665, nosort=3313713, attrs=0, id_format=3313665)
>     at /vol/freeware/cvs/emacs/head/emacs/src/dired.c:226
> 226           if (dp == NULL && errno == EAGAIN)
> (gdb) p directory
> $1 = 16076323
> (gdb) pr
> "/vol/cld_scratch"
> 
> (gdb) xbacktrace
>  "directory-files"
>  "apply"
>  "ecb-directory-files"
>  "ecb-check-emptyness-of-dir"
>  "ecb-stealthy-empty-dir-check"
>  "ecb-stealthy-updates"
>  "apply"
>  "byte-code"
>  "timer-event-handler"
> 
> I think emacs waits for readdir in dired.c:223 to complete and
> unfortunately C-g doesn't work during stealthy update.

ECB encapslates ist "stealthy" tasks in a loop like:

        (while (and (not (input-pending-p))
                ...

So IMHO C-g should work....

AFAIK there is a new macro in CVS named `while-no-input' (there
was a discussion some time ago).... Could using this macro
solve problems like that posted from the OP??

Ciao,
Klaus

> 
> The culprit BTW is a mount point to a VAX cluster that e.g. need 20
> minutes 
> to return from 'M-x eval-expression (directory-files
> "/vol/cld_scratch")'. While I can interrupt 'M-x eval-expression
> (directory-files "/vol/cld_scratch")' with C-g just fine, C-g has no
> effect when this command is run from timer-event-handler.
> 
>>  Klaus Zeitler      Lucent Technologies  |
>>  Email:             kzeitler@lucent.com  |
>  ------------------------------------------
> ---
> The only problem with being a man of leisure
> is that you can never stop and take a rest.
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread
* AW: Can't interrupt directory_files_internal run fromtimer-event-handler
@ 2005-08-10  9:35 klaus.berndl
  2005-08-12  6:59 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: klaus.berndl @ 2005-08-10  9:35 UTC (permalink / raw)
  Cc: kzeitler, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1450 bytes --]

>> ECB encapslates ist "stealthy" tasks in a loop like:

>>         (while (and (not (input-pending-p))
>>                 ...

>> So IMHO C-g should work....

>Only if each iteration takes a (small) finite time.  The OP's problem is
>that one of the iteration doesn't terminate.

i know - therefore my question concerning while-no-input!
In fact: ECB has some tasks which should be run really(!) stealthy, like
checking if a dir is empty, getting the VC-state of all files in a dir,
checking which files in a dir are read-only... in case of a remote host
an iteration of such a task (i.e. for one file of a dir) can be potentially
long lasting...

With the current available elisp-tools (macos, functions etc.) ECB can run
these tasks only pseudo-stealthy...therefore a way to make this really stealthy
would be very important for ECB so users are not blocked...

I have no preference how to achieve this (while-no-input, with-local-quit etc..),
but i would be great if i could achieve this goal at all!

>> AFAIK there is a new macro in CVS named `while-no-input' (there
>> was a discussion some time ago).... Could using this macro
>> solve problems like that posted from the OP??

>Could be.  Another related new macro is with-local-quit (which uses no new
>internal feature and can thus be backported to other Emacsen).

see above - what would be the best way to enable real stealthiness?

Thanks a lot,
Klaus

[-- Attachment #1.2: Type: text/html, Size: 2200 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread
* AW: Can't interrupt directory_files_internal run fromtimer-event-handler
@ 2005-08-12  8:00 klaus.berndl
  2005-08-12 11:59 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: klaus.berndl @ 2005-08-12  8:00 UTC (permalink / raw)
  Cc: kzeitler, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1049 bytes --]

>> With the current available elisp-tools (macos, functions etc.) ECB can run
>> these tasks only pseudo-stealthy...therefore a way to make this really
>> stealthy would be very important for ECB so users are not blocked...

>> I have no preference how to achieve this (while-no-input, with-local-quit
>> etc..), but i would be great if i could achieve this goal at all!

>Do you expect us to figure out what's best for you?

no

>I'd say use while-no-input but you're in a better position to make this call.

the only thing i wanted is: An expert-estimation if while-no-input is a good
way - or with-local-quit - if i remember right you said that this could
easily being backported - maybe its not a really good idea to use a macro
which is only available in forthcoming Emacs 22 - IMHO also users of Emacs 21.X
should get a good solution...

is there a short example how to use this with-local-quit? This would help me
a lot - or a pointer where to find such an example..

Thanks for your help,
Klaus


        Stefan


[-- Attachment #1.2: Type: text/html, Size: 1648 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-08-12 11:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-05 12:01 Can't interrupt directory_files_internal run fromtimer-event-handler klaus.berndl
2005-08-05 12:53 ` Juanma Barranquero
2005-08-06  6:27   ` Richard M. Stallman
2005-08-06 11:58     ` Juanma Barranquero
2005-08-06 23:39     ` Kim F. Storm
2005-08-08 12:09       ` Richard M. Stallman
2005-08-09 23:29 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2005-08-10  9:35 AW: " klaus.berndl
2005-08-12  6:59 ` Stefan Monnier
2005-08-12  8:00 AW: " klaus.berndl
2005-08-12 11:59 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).