unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
@ 2015-11-19 20:29 Alexander Shukaev
  2015-11-19 20:36 ` John Wiegley
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Alexander Shukaev @ 2015-11-19 20:29 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

This discussion might be with some rant flavor, and I apologize for
that beforehand.  Currently, I have to work with directories mounted
from network.  As a result, Dired either opens them slowly or hangs
forever (looks like a bug and/or glitch).  I personally find this very
frustrating, especially when I'm in the middle of work with 50+
buffers open (some of which are still in modified state).  The only
way to recover from such problems is to kill the Emacs process.

I've read numerous times on these mailing lists that nobody is really
willing to introduce multi-threading due to historical reasons, and
that Emacs is an inherently single-threaded environment which is not
designed to support multi-threading, and bla bla bla...  On the one
hand, I can understand all the above as a rationale.  On the other
hand, in 2015, it sounds like an amateur excuse.  I mean, seriously,
how can so advanced text editor with ~30 year history be so unreliable
and fragile to work with in randomly occurring cases?  It may freeze
or it may not freeze, but if it does, all of the unsaved work is lost,
not to mention the fact that all of the layout of windows and open
buffers are lost as well.  It's literally UNACCEPTABLE.

Now, I'm not here to teach Emacs developers what to do or annoy
anybody.  First of all, I just want to once again draw your attention
to one of the urgent issues (to this date) of Emacs.  And, secondly, I
want to ask whether there exists a way to solve the problem described
above without multi-threading?  For instance, I believe I saw
something like `defer' package.  My question is: how can I (perhaps)
advise Dired functions (at least for opening directories), so that
they execute asynchronously (at least for interactive use, for
example)?  Currently, I know only one way to avoid this: run another
instance of Emacs which is dedicated exclusively for browsing with
Dired, and that's still kinda lame and limited (as you can't really
open files into another instance of Emacs, where you do your real
work).

Thanks and regards,
Alexander



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:29 Alexander Shukaev
@ 2015-11-19 20:36 ` John Wiegley
  2015-11-19 20:57   ` Alexander Shukaev
  2015-11-19 20:46 ` Eli Zaretskii
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: John Wiegley @ 2015-11-19 20:36 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: help-gnu-emacs

>>>>> Alexander Shukaev <haroogan@gmail.com> writes:

> I've read numerous times on these mailing lists that nobody is really
> willing to introduce multi-threading due to historical reasons, and that
> Emacs is an inherently single-threaded environment which is not designed to
> support multi-threading, and bla bla bla...

Actually, I have some good news for you: Concurrency of some form is being
seriously considered for Emacs 26. It will likely not allow *asynchronicity*
until 27 or 28, and even then perhaps only via a process separation model, but
we are indeed headed in the direction of modernity -- albeit at the safest
pace we can manage.

I hear your frustration, and appreciate you taking the time to express it
here. Please join the emacs-devel mailing list if you'd like to become a part
of future design discussions concerning this functionality.

John



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:29 Alexander Shukaev
  2015-11-19 20:36 ` John Wiegley
@ 2015-11-19 20:46 ` Eli Zaretskii
  2015-11-19 20:55   ` Alexander Shukaev
       [not found]   ` <mailman.264.1447966512.31583.help-gnu-emacs@gnu.org>
  2015-11-19 21:25 ` Dmitry Gutov
       [not found] ` <mailman.262.1447966007.31583.help-gnu-emacs@gnu.org>
  3 siblings, 2 replies; 25+ messages in thread
From: Eli Zaretskii @ 2015-11-19 20:46 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 19 Nov 2015 21:29:04 +0100
> From: Alexander Shukaev <haroogan@gmail.com>
> 
> This discussion might be with some rant flavor, and I apologize for
> that beforehand.  Currently, I have to work with directories mounted
> from network.  As a result, Dired either opens them slowly or hangs
> forever (looks like a bug and/or glitch).  I personally find this very
> frustrating, especially when I'm in the middle of work with 50+
> buffers open (some of which are still in modified state).  The only
> way to recover from such problems is to kill the Emacs process.

You are on Windows, right?

> how can so advanced text editor with ~30 year history be so unreliable
> and fragile to work with in randomly occurring cases?

FWIW, it isn't unreliable or fragile for me.  It is rather rock-solid,
my sessions are usually open for many weeks on end, and almost never
crash or hang.

> It may freeze or it may not freeze, but if it does, all of the
> unsaved work is lost, not to mention the fact that all of the layout
> of windows and open buffers are lost as well.

Neither of this is true.  When Emacs hits a fatal error, it
auto-saves, and if you activate the desktop-saving feature, it will
save a snapshot of your window and frame configuration fairly
frequently, so starting a new session recreates at least those buffers
which were visiting files or directories.

> First of all, I just want to once again draw your attention to one
> of the urgent issues (to this date) of Emacs.

Which urgent issue is that?

> And, secondly, I want to ask whether there exists a way to solve the
> problem described above without multi-threading?

On Posix systems, Emacs does use a kind of multi-threading: it invokes
the 'ls' command to generate the directory listing.  You can configure
Emacs on Windows to do the same, if you can get your hands on a decent
port of GNU 'ls'.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:46 ` Eli Zaretskii
@ 2015-11-19 20:55   ` Alexander Shukaev
  2015-11-19 21:09     ` Eli Zaretskii
       [not found]   ` <mailman.264.1447966512.31583.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-11-19 20:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Thu, Nov 19, 2015 at 9:46 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Thu, 19 Nov 2015 21:29:04 +0100
>> From: Alexander Shukaev <haroogan@gmail.com>
>>
>> This discussion might be with some rant flavor, and I apologize for
>> that beforehand.  Currently, I have to work with directories mounted
>> from network.  As a result, Dired either opens them slowly or hangs
>> forever (looks like a bug and/or glitch).  I personally find this very
>> frustrating, especially when I'm in the middle of work with 50+
>> buffers open (some of which are still in modified state).  The only
>> way to recover from such problems is to kill the Emacs process.
>
> You are on Windows, right?

In this particular case, I'm talking about Linux and directories
mounted from network.

>> how can so advanced text editor with ~30 year history be so unreliable
>> and fragile to work with in randomly occurring cases?
>
> FWIW, it isn't unreliable or fragile for me.  It is rather rock-solid,
> my sessions are usually open for many weeks on end, and almost never
> crash or hang.

Exactly, "almost never", but hangs DO happen.

>> It may freeze or it may not freeze, but if it does, all of the
>> unsaved work is lost, not to mention the fact that all of the layout
>> of windows and open buffers are lost as well.
>
> Neither of this is true.  When Emacs hits a fatal error, it
> auto-saves, and if you activate the desktop-saving feature, it will
> save a snapshot of your window and frame configuration fairly
> frequently, so starting a new session recreates at least those buffers
> which were visiting files or directories.

Could you please provide concrete settings for this?  Also, maybe it
does save on fatal error, but you have no chance of saving upon
killing the Emacs process due to dead hang.

>> First of all, I just want to once again draw your attention to one
>> of the urgent issues (to this date) of Emacs.
>
> Which urgent issue is that?

The one described above: dead handing.

>> And, secondly, I want to ask whether there exists a way to solve the
>> problem described above without multi-threading?
>
> On Posix systems, Emacs does use a kind of multi-threading: it invokes
> the 'ls' command to generate the directory listing.  You can configure
> Emacs on Windows to do the same, if you can get your hands on a decent
> port of GNU 'ls'.
>

I'm using 'ls' on both Linux and Windows and this does not prevent the
occasional hang on network directories.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:36 ` John Wiegley
@ 2015-11-19 20:57   ` Alexander Shukaev
  2015-11-19 21:15     ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-11-19 20:57 UTC (permalink / raw)
  To: wiegley; +Cc: help-gnu-emacs

On Thu, Nov 19, 2015 at 9:36 PM, John Wiegley <jwiegley@gmail.com> wrote:
>>>>>> Alexander Shukaev <haroogan@gmail.com> writes:
>
>> I've read numerous times on these mailing lists that nobody is really
>> willing to introduce multi-threading due to historical reasons, and that
>> Emacs is an inherently single-threaded environment which is not designed to
>> support multi-threading, and bla bla bla...
>
> Actually, I have some good news for you: Concurrency of some form is being
> seriously considered for Emacs 26. It will likely not allow *asynchronicity*
> until 27 or 28, and even then perhaps only via a process separation model, but
> we are indeed headed in the direction of modernity -- albeit at the safest
> pace we can manage.
>
> I hear your frustration, and appreciate you taking the time to express it
> here. Please join the emacs-devel mailing list if you'd like to become a part
> of future design discussions concerning this functionality.
>
> John

John, seriously, these are wonderful news!  I'm in emacs-devel for a
long time already.  I gotta catch up with this topic.  Thank you for
this information.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:55   ` Alexander Shukaev
@ 2015-11-19 21:09     ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2015-11-19 21:09 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 19 Nov 2015 21:55:06 +0100
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> > FWIW, it isn't unreliable or fragile for me.  It is rather rock-solid,
> > my sessions are usually open for many weeks on end, and almost never
> > crash or hang.
> 
> Exactly, "almost never", but hangs DO happen.

Not here.  I have crashes maybe once or twice a year, that's all.  No
hangs.

> >> It may freeze or it may not freeze, but if it does, all of the
> >> unsaved work is lost, not to mention the fact that all of the layout
> >> of windows and open buffers are lost as well.
> >
> > Neither of this is true.  When Emacs hits a fatal error, it
> > auto-saves, and if you activate the desktop-saving feature, it will
> > save a snapshot of your window and frame configuration fairly
> > frequently, so starting a new session recreates at least those buffers
> > which were visiting files or directories.
> 
> Could you please provide concrete settings for this?

Desktop saving is in the manual, see the node "Saving Emacs Sessions".

Auto-saving on fatal errors happens by default, but you should select
the signal you use to kill Emacs wisely: e.g., "kill -9" is usually a
bad idea.

> Also, maybe it does save on fatal error, but you have no chance of
> saving upon killing the Emacs process due to dead hang.

Signals that can be caught are treated the same as fatal errors.
Emacs catches them all, and auto-saves before committing suicide.

You can also bind commands to SIGUSR1 and SIGUSR2 events, you will
find documentation and example in the "Misc Events" node of the ELisp
manual.  Then you can "kill -USR1 emacs-PID", and have it auto-save,
or maybe call 'error' to get to top level.

> >> First of all, I just want to once again draw your attention to one
> >> of the urgent issues (to this date) of Emacs.
> >
> > Which urgent issue is that?
> 
> The one described above: dead handing.

AFAIR, you are the first who thinks this happens frequently enough to
be a serious issue.  Unless you are using development snapshots, where
all bets are off.  (I was talking about official releases.)  But
anyway, in every such case attaching the debugger to Emacs and
reporting a bug with the details about where it hangs, or at least
providing a recipe and any information regarding the hang you can come
up with, is the only efficient way to make the situation better.
Complaining here certainly won't cut it.

> >> And, secondly, I want to ask whether there exists a way to solve the
> >> problem described above without multi-threading?
> >
> > On Posix systems, Emacs does use a kind of multi-threading: it invokes
> > the 'ls' command to generate the directory listing.  You can configure
> > Emacs on Windows to do the same, if you can get your hands on a decent
> > port of GNU 'ls'.
> >
> 
> I'm using 'ls' on both Linux and Windows and this does not prevent the
> occasional hang on network directories.

But then it's 'ls' that's hanging, not Emacs, right?  Emacs just waits
for 'ls', and it should be relatively easy to interrupt the wait,
either by "C-g" or by sending a signal, see above.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
       [not found] <mailman.258.1447964949.31583.help-gnu-emacs@gnu.org>
@ 2015-11-19 21:09 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 25+ messages in thread
From: Pascal J. Bourguignon @ 2015-11-19 21:09 UTC (permalink / raw)
  To: help-gnu-emacs

Alexander Shukaev <haroogan@gmail.com> writes:

> It may freeze or it may not freeze, but if it does, all of the unsaved
> work is lost, not to mention the fact that all of the layout of
> windows and open buffers are lost as well.  It's literally
> UNACCEPTABLE.

Would the introduction of threads increase or decrease the freezing
occurences?


> Currently, I know only one way to avoid this: run another
> instance of Emacs which is dedicated exclusively for browsing with
> Dired, and that's still kinda lame and limited (as you can't really
> open files into another instance of Emacs, where you do your real
> work).

I do use three instances too: gnus, erc, and development.  I wouldn't
expect accessing directories to freeze emacs, unless you access them
thru nfs, but then that'd freeze even the kernel!  Just wait for the
server to come back on again.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
       [not found]   ` <mailman.264.1447966512.31583.help-gnu-emacs@gnu.org>
@ 2015-11-19 21:11     ` Pascal J. Bourguignon
  2015-11-20  0:36       ` Bob Proulx
       [not found]       ` <mailman.285.1447979800.31583.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 25+ messages in thread
From: Pascal J. Bourguignon @ 2015-11-19 21:11 UTC (permalink / raw)
  To: help-gnu-emacs

Alexander Shukaev <haroogan@gmail.com> writes:

> In this particular case, I'm talking about Linux and directories
> mounted from network.

Yeah, right.

This freezes unix, not emacs.  You might prefer to access remote files
using tramp.


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:57   ` Alexander Shukaev
@ 2015-11-19 21:15     ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2015-11-19 21:15 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 19 Nov 2015 21:57:37 +0100
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> > Actually, I have some good news for you: Concurrency of some form is being
> > seriously considered for Emacs 26. It will likely not allow *asynchronicity*
> > until 27 or 28, and even then perhaps only via a process separation model, but
> > we are indeed headed in the direction of modernity -- albeit at the safest
> > pace we can manage.
> >
> > I hear your frustration, and appreciate you taking the time to express it
> > here. Please join the emacs-devel mailing list if you'd like to become a part
> > of future design discussions concerning this functionality.
> >
> > John
> 
> John, seriously, these are wonderful news!  I'm in emacs-devel for a
> long time already.  I gotta catch up with this topic.  Thank you for
> this information.

Don't hold your breath just yet, that goal is still far away.

I think at this point, if the problem is getting the directory
listing, patches to insert-directory that would invoke 'ls'
asynchronously will get you what you want much faster and more
reliably.  Patches to that effect are welcome.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 20:29 Alexander Shukaev
  2015-11-19 20:36 ` John Wiegley
  2015-11-19 20:46 ` Eli Zaretskii
@ 2015-11-19 21:25 ` Dmitry Gutov
  2015-11-19 21:43   ` Random832
       [not found] ` <mailman.262.1447966007.31583.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 25+ messages in thread
From: Dmitry Gutov @ 2015-11-19 21:25 UTC (permalink / raw)
  To: Alexander Shukaev, help-gnu-emacs

On 11/19/2015 10:29 PM, Alexander Shukaev wrote:
> The only
> way to recover from such problems is to kill the Emacs process.

Have you tried pressing C-g a few times?

> I mean, seriously,
> how can so advanced text editor with ~30 year history be so unreliable
> and fragile to work with in randomly occurring cases?  It may freeze
> or it may not freeze, but if it does, all of the unsaved work is lost,
> not to mention the fact that all of the layout of windows and open
> buffers are lost as well.  It's literally UNACCEPTABLE.

How will multi-threading fix that? Sure, Emacs might keep working in the 
other buffers, but now you have a frozen/dead thread on your hands, 
which probably takes up 100% CPU. And if the UI is still working, you're 
free to create more frozen threads like that.

As a rough guess, any proper solution to frozen threads of execution can 
also be applied to the current codebase.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 21:25 ` Dmitry Gutov
@ 2015-11-19 21:43   ` Random832
  2015-11-19 22:18     ` Dmitry Gutov
  0 siblings, 1 reply; 25+ messages in thread
From: Random832 @ 2015-11-19 21:43 UTC (permalink / raw)
  To: help-gnu-emacs

Dmitry Gutov <dgutov@yandex.ru> writes:
> How will multi-threading fix that? Sure, Emacs might keep working in
> the other buffers, but now you have a frozen/dead thread on your
> hands, which probably takes up 100% CPU.

Why would it take 100% CPU? We're talking about an I/O wait.

> And if the UI is still
> working, you're free to create more frozen threads like that.

But he's also free to go do something else that doesn't require reading
from that directory, or waiting for a connection to time out, etc.




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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 21:43   ` Random832
@ 2015-11-19 22:18     ` Dmitry Gutov
  2015-11-20  7:54       ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Dmitry Gutov @ 2015-11-19 22:18 UTC (permalink / raw)
  To: Random832, help-gnu-emacs

On 11/19/2015 11:43 PM, Random832 wrote:

> Why would it take 100% CPU? We're talking about an I/O wait.

I took that from your description. Maybe not 100%, all right, then just 
a dead thread. Also not stellar user experience.

Emacs can work fine with slow external processes; we interact with them 
asynchronously. If Dired doesn't (I'm not sure), that could be fixed.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 21:11     ` Pascal J. Bourguignon
@ 2015-11-20  0:36       ` Bob Proulx
  2015-11-20 10:49         ` Rasmus
                           ` (2 more replies)
       [not found]       ` <mailman.285.1447979800.31583.help-gnu-emacs@gnu.org>
  1 sibling, 3 replies; 25+ messages in thread
From: Bob Proulx @ 2015-11-20  0:36 UTC (permalink / raw)
  To: help-gnu-emacs

Pascal J. Bourguignon wrote:
> Alexander Shukaev writes:
> > In this particular case, I'm talking about Linux and directories
> > mounted from network.
> 
> Yeah, right.
> 
> This freezes unix, not emacs.  You might prefer to access remote files
> using tramp.

I want to emphasize this.  If you are accessing files over NFS and for
whatever reason the NFS server goes away this causes the NFS client in
the local kernel to wait.  The "freeze" you are seeing is a freeze in
the NFS client and not Emacs.  The problem is in the kernel not emacs.

NFS client is implemented in the kernel.  When it locks up there is
absolutely nothing an application can do to unlock the kernel.  This
has been a plague on NFS forever.  Problems with the NFS client are
the one thing that may require the workstation to be rebooted.
Because if it were an application in userspace one could kill and
restart it.  But because NFS is implemented in the kernel the only way
to kill and restart the kernel is to reboot.

The only way to win is not to play.  Which is what Pascal suggests
with using emacs tramp to avoid nfs client and instead use ssh or
other to access those files.  Because tramp operates entirely in
userspace it can't lock up the same way.

Bob

P.S. Emacs has been rock solid for me for the last decade.  I can't
remember the last time I experienced an emacs crash.  Bugs in
behavior?  Sure.  But no crashes.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
       [not found]       ` <mailman.285.1447979800.31583.help-gnu-emacs@gnu.org>
@ 2015-11-20  7:53         ` Loris Bennett
  2015-11-20  9:42           ` Michael Albinus
  0 siblings, 1 reply; 25+ messages in thread
From: Loris Bennett @ 2015-11-20  7:53 UTC (permalink / raw)
  To: help-gnu-emacs

Bob Proulx <bob@proulx.com> writes:

> Pascal J. Bourguignon wrote:
>> Alexander Shukaev writes:
>> > In this particular case, I'm talking about Linux and directories
>> > mounted from network.
>> 
>> Yeah, right.
>> 
>> This freezes unix, not emacs.  You might prefer to access remote files
>> using tramp.
>
> I want to emphasize this.  If you are accessing files over NFS and for
> whatever reason the NFS server goes away this causes the NFS client in
> the local kernel to wait.  The "freeze" you are seeing is a freeze in
> the NFS client and not Emacs.  The problem is in the kernel not emacs.
>
> NFS client is implemented in the kernel.  When it locks up there is
> absolutely nothing an application can do to unlock the kernel.  This
> has been a plague on NFS forever.  Problems with the NFS client are
> the one thing that may require the workstation to be rebooted.
> Because if it were an application in userspace one could kill and
> restart it.  But because NFS is implemented in the kernel the only way
> to kill and restart the kernel is to reboot.
>
> The only way to win is not to play.  Which is what Pascal suggests
> with using emacs tramp to avoid nfs client and instead use ssh or
> other to access those files.  Because tramp operates entirely in
> userspace it can't lock up the same way.

I mount remote directories via sshfs in my laptop so that I can access
them both via a terminal and within emacs.  I experience hang-ups if
I switch my connection from ethernet to wireless, which changes the IP
address.  I haven't noticed other programs having problems when the
network changes, but then again, I don't use that many other programs.

As I understand it, sshfs is also implemented in userspace, so is there
some other reason why tramp might be more robust with respect to changes
in the network configuration?

Cheers,

Loris

> Bob
>
> P.S. Emacs has been rock solid for me for the last decade.  I can't
> remember the last time I experienced an emacs crash.  Bugs in
> behavior?  Sure.  But no crashes.


-- 
This signature is currently under construction.


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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-19 22:18     ` Dmitry Gutov
@ 2015-11-20  7:54       ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2015-11-20  7:54 UTC (permalink / raw)
  To: help-gnu-emacs

> Emacs can work fine with slow external processes; we interact with them 
> asynchronously. If Dired doesn't (I'm not sure)

It doesn't.  It calls call-process.  (And it's not Dired itself, it's
the insert-directory function that Emacs provides.)

> that could be fixed.

Indeed, I think doing that will go along way towards solving the
problems with listing slow directories, let alone getting hung while
at that.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-20  7:53         ` Loris Bennett
@ 2015-11-20  9:42           ` Michael Albinus
  0 siblings, 0 replies; 25+ messages in thread
From: Michael Albinus @ 2015-11-20  9:42 UTC (permalink / raw)
  To: Loris Bennett; +Cc: help-gnu-emacs

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

> I mount remote directories via sshfs in my laptop so that I can access
> them both via a terminal and within emacs.  I experience hang-ups if
> I switch my connection from ethernet to wireless, which changes the IP
> address.  I haven't noticed other programs having problems when the
> network changes, but then again, I don't use that many other programs.
>
> As I understand it, sshfs is also implemented in userspace, so is there
> some other reason why tramp might be more robust with respect to changes
> in the network configuration?

Tramp uses timeouts when accessing remote connections. Maybe more
aggressive (shorter) timeouts than sshfs.

> Cheers,
>
> Loris

Best regards, Michael.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-20  0:36       ` Bob Proulx
@ 2015-11-20 10:49         ` Rasmus
  2015-11-22 21:43         ` Xavier Maillard
  2015-11-23  1:19         ` MBR
  2 siblings, 0 replies; 25+ messages in thread
From: Rasmus @ 2015-11-20 10:49 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

Bob Proulx <bob@proulx.com> writes:

> Pascal J. Bourguignon wrote:
>> Alexander Shukaev writes:
>> > In this particular case, I'm talking about Linux and directories
>
>> > mounted from network.
>> 
>> Yeah, right.
>> 
>> This freezes unix, not emacs.  You might prefer to access remote files
>> using tramp.
>
> I want to emphasize this.  If you are accessing files over NFS and for
> whatever reason the NFS server goes away this causes the NFS client in
> the local kernel to wait.  The "freeze" you are seeing is a freeze in
> the NFS client and not Emacs.  The problem is in the kernel not emacs.
>
> NFS client is implemented in the kernel.  When it locks up there is
> absolutely nothing an application can do to unlock the kernel.  This
> has been a plague on NFS forever.  Problems with the NFS client are
> the one thing that may require the workstation to be rebooted.
> Because if it were an application in userspace one could kill and
> restart it.  But because NFS is implemented in the kernel the only way
> to kill and restart the kernel is to reboot.

Interesting write-up.  Thanks.

As an aside: I used to have this problem when I would connect to my NFS
server at home, where I would add symlinks to ~ (e.g. ~/music/ ->
/mnt/nas/music).  When I’d put the laptop to sleep without disconnecting
first and then waking it at some other place, my computer would not even
be able to restart as I recall!

I think I usually managed to recover by issuing something like,
    umount -fl /mnt/nas/music
But it’s a few years back, so I might be looking at the wrong script...

Rasmus

-- 
A page of history is worth a volume of logic




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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-20  0:36       ` Bob Proulx
  2015-11-20 10:49         ` Rasmus
@ 2015-11-22 21:43         ` Xavier Maillard
  2015-11-22 22:24           ` Stefan Monnier
  2015-11-23  3:34           ` Eli Zaretskii
  2015-11-23  1:19         ` MBR
  2 siblings, 2 replies; 25+ messages in thread
From: Xavier Maillard @ 2015-11-22 21:43 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Bob,

Bob Proulx <bob@proulx.com> writes:

> P.S. Emacs has been rock solid for me for the last decade.  I can't
> remember the last time I experienced an emacs crash.  Bugs in
> behavior?  Sure.  But no crashes.

Until I bought an OS X machine (yeah, this is lame), I would have argued the
same: decades of stability and reliability. Now, my uptime is quite
ridiculous: few days at most (full crash + sometimes, OS reboot ... ).

I am using (home)brew version, maybe that's explain this (new) behavior ;)

-- Xavier.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-22 21:43         ` Xavier Maillard
@ 2015-11-22 22:24           ` Stefan Monnier
  2015-11-23  5:11             ` Xavier Maillard
  2015-11-23  3:34           ` Eli Zaretskii
  1 sibling, 1 reply; 25+ messages in thread
From: Stefan Monnier @ 2015-11-22 22:24 UTC (permalink / raw)
  To: help-gnu-emacs

> ridiculous: few days at most (full crash + sometimes, OS reboot ... ).

Emacs can't be responsible for an OS reboot (it might trigger a bug in
the underlying OS, but the cause would still be a bug in the OS).


        Stefan




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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
       [not found] ` <mailman.262.1447966007.31583.help-gnu-emacs@gnu.org>
@ 2015-11-23  0:12   ` Jason Rumney
  0 siblings, 0 replies; 25+ messages in thread
From: Jason Rumney @ 2015-11-23  0:12 UTC (permalink / raw)
  To: help-gnu-emacs

On Friday, 20 November 2015 04:46:50 UTC+8, Eli Zaretskii  wrote:
> > Date: Thu, 19 Nov 2015 21:29:04 +0100
> > From: Alexander Shukaev <haroogan@gmail.com>
> > 
> > Currently, I have to work with directories mounted from network.
> 
> You are on Windows, right?

I have problems with Emacs hanging on Windows when UNC paths are used.  It is caused by GNU Global that is processing the buffer contents as a background process, but does not handle UNC paths. Other external processes may cause the same problem.  Killing global.exe from Task Manager solves the hang for me.


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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-20  0:36       ` Bob Proulx
  2015-11-20 10:49         ` Rasmus
  2015-11-22 21:43         ` Xavier Maillard
@ 2015-11-23  1:19         ` MBR
  2 siblings, 0 replies; 25+ messages in thread
From: MBR @ 2015-11-23  1:19 UTC (permalink / raw)
  To: help-gnu-emacs

On 11/19/15 7:36 PM, Bob Proulx wrote:
> P.S. Emacs has been rock solid for me for the last decade.  I can't
> remember the last time I experienced an emacs crash.  Bugs in
> behavior?  Sure.  But no crashes.
I tend to leave my Emacs sessions open forever.  Back in the 1990s on 
Solaris or AIX, Emacs would stay up for months at a time.  I'd only shut 
it down when I had to power-cycle the machine.  From about 2000 to 2012 
my primary machines were Windows, and my experience with the Windows 
version of Emacs was pretty similar.  A couple of years ago when I 
switched to a Mac, I compiled Emacs 24.3.1 from source, and I've been 
using it regularly since then.  But although my experience with this 
version is good, it's not as crash-proof as I was used to with earlier 
Emacses.  I seem to encounter either hangs (the multi-colored spinner 
spins and Activity Monitor reports Emacs as "not responding") or 
outright crashes (a dialog box appears saying Emacs has to exit and 
asking if I want to restart Emacs) once or twice a month.

I do have a nasty habit of having a zillion Emacs buffers open at once, 
and I usually also have an instance of Firefox running at the same time 
in which I typically have about 20 windows open with approx. 10 tabs in 
each window.  I've just been chalking the more frequent Emacs crashes 
and hangs up to running out of memory.  But this is a pretty fully 
configured laptop, and it's got 16 GB of RAM.  Should I be looking 
elsewhere for the cause?

    Mark Rosenthal




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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-22 21:43         ` Xavier Maillard
  2015-11-22 22:24           ` Stefan Monnier
@ 2015-11-23  3:34           ` Eli Zaretskii
  2015-11-23  5:13             ` Xavier Maillard
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-11-23  3:34 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Xavier Maillard <lists.emacs.help@xavier.maillard.im>
> Date: Sun, 22 Nov 2015 22:43:43 +0100
> 
> Until I bought an OS X machine (yeah, this is lame), I would have argued the
> same: decades of stability and reliability. Now, my uptime is quite
> ridiculous: few days at most (full crash + sometimes, OS reboot ... ).
> 
> I am using (home)brew version, maybe that's explain this (new) behavior ;)

We didn't have an active enough maintainer on board who would take
care of the OS X build, which is quite different in several aspects.
Now we have such a person at last, hopefully things will become
better.



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-22 22:24           ` Stefan Monnier
@ 2015-11-23  5:11             ` Xavier Maillard
  0 siblings, 0 replies; 25+ messages in thread
From: Xavier Maillard @ 2015-11-23  5:11 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> ridiculous: few days at most (full crash + sometimes, OS reboot ... ).
>
> Emacs can't be responsible for an OS reboot (it might trigger a bug in
> the underlying OS, but the cause would still be a bug in the OS).

I agree 100% Stefan. I just wanted to report there are things to debug and I'd
be happy to help in this regard (just need informations on how to do it on
this platform).

-- Xavier.
<#secure method=pgpmime mode=encrypt>




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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-23  3:34           ` Eli Zaretskii
@ 2015-11-23  5:13             ` Xavier Maillard
  2015-11-23 13:52               ` John Wiegley
  0 siblings, 1 reply; 25+ messages in thread
From: Xavier Maillard @ 2015-11-23  5:13 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Xavier Maillard <lists.emacs.help@xavier.maillard.im>
>> Date: Sun, 22 Nov 2015 22:43:43 +0100
>> 
>> Until I bought an OS X machine (yeah, this is lame), I would have argued the
>> same: decades of stability and reliability. Now, my uptime is quite
>> ridiculous: few days at most (full crash + sometimes, OS reboot ... ).
>> 
>> I am using (home)brew version, maybe that's explain this (new) behavior ;)
>
> We didn't have an active enough maintainer on board who would take
> care of the OS X build, which is quite different in several aspects.
> Now we have such a person at last, hopefully things will become
> better.

In case it is needed, I would be quite happy to help since it is starting to
get on my nerves ;)

-- Xavier.
<#secure method=pgpmime mode=encrypt>



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

* Re: It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard!
  2015-11-23  5:13             ` Xavier Maillard
@ 2015-11-23 13:52               ` John Wiegley
  0 siblings, 0 replies; 25+ messages in thread
From: John Wiegley @ 2015-11-23 13:52 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> Xavier Maillard <lists.emacs.help@xavier.maillard.im> writes:

>> We didn't have an active enough maintainer on board who would take care of
>> the OS X build, which is quite different in several aspects. Now we have
>> such a person at last, hopefully things will become better.

> In case it is needed, I would be quite happy to help since it is starting to
> get on my nerves ;)

Any such help would be greatly appreciated. :)

John



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

end of thread, other threads:[~2015-11-23 13:52 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.258.1447964949.31583.help-gnu-emacs@gnu.org>
2015-11-19 21:09 ` It's almost 2016 and when (single-threaded) Emacs hangs, you gotta be smashing your keyboard! Pascal J. Bourguignon
2015-11-19 20:29 Alexander Shukaev
2015-11-19 20:36 ` John Wiegley
2015-11-19 20:57   ` Alexander Shukaev
2015-11-19 21:15     ` Eli Zaretskii
2015-11-19 20:46 ` Eli Zaretskii
2015-11-19 20:55   ` Alexander Shukaev
2015-11-19 21:09     ` Eli Zaretskii
     [not found]   ` <mailman.264.1447966512.31583.help-gnu-emacs@gnu.org>
2015-11-19 21:11     ` Pascal J. Bourguignon
2015-11-20  0:36       ` Bob Proulx
2015-11-20 10:49         ` Rasmus
2015-11-22 21:43         ` Xavier Maillard
2015-11-22 22:24           ` Stefan Monnier
2015-11-23  5:11             ` Xavier Maillard
2015-11-23  3:34           ` Eli Zaretskii
2015-11-23  5:13             ` Xavier Maillard
2015-11-23 13:52               ` John Wiegley
2015-11-23  1:19         ` MBR
     [not found]       ` <mailman.285.1447979800.31583.help-gnu-emacs@gnu.org>
2015-11-20  7:53         ` Loris Bennett
2015-11-20  9:42           ` Michael Albinus
2015-11-19 21:25 ` Dmitry Gutov
2015-11-19 21:43   ` Random832
2015-11-19 22:18     ` Dmitry Gutov
2015-11-20  7:54       ` Eli Zaretskii
     [not found] ` <mailman.262.1447966007.31583.help-gnu-emacs@gnu.org>
2015-11-23  0:12   ` Jason Rumney

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).