Don Ho a3535f385f Fix network files hanging while the network disconnected (part 2)
Refactoring for reducing the I/O calls, fix typos.

Reduce the startup time (while the a dirty disconnected network file is in the session) from about 12-15 seconds to about 6 seconds (on my laptop).

Note that there are 2 cases are not improved by the commit:

* STR 1: Open a network file, modify it. Disconnect the network, then save the file.

There will be a huge hanging time (around 1 minute) to get the warning dialog.
I tried to remedy with thread for CreateFileW in the constructor of Win32_IO_File, however it leads crash due to the lock guard in the caller.

* STR 2:
1. Open a network file.
2. Close Notepad++ to have it in the session.
3. Disconnect the network, and launch Notepad++ immediately.
4. Around more than 1 minute's delay, then the "Error" dialog displayed.

The reason of hanging is that the network file was detected by "doesFileExist" as true, so Notepad++ was trying to open non-existent file (by _wfopen).
I believe that there's some kind of cache during the very short period for the IO function (here's our case GetFileAttributes), and such cache is not immediately synchronized (cleared) while network disconnected. As a result, when we launch Notepad++ after the disconnection of network, GetFileAttributes keeps its memory & responds "FileExists". However for _wfopen it doesn't see the resource of network anymore - that makes hanging.

Ref #15658
Improve #4306, #6178, #8055, #11388, #12553, #15540
Close #15669
2024-10-04 18:04:15 +02:00
2023-04-06 14:12:52 +02:00
2023-11-03 23:26:44 +01:00
2024-05-25 16:19:47 +02:00
2024-02-03 15:04:34 +01:00
2024-03-13 00:32:57 +01:00
2024-03-14 04:33:24 +01:00
2024-02-01 16:28:17 +01:00

What is Notepad++ ?

GitHub release    Build Status     Join the discussions at https://community.notepad-plus-plus.org/

Notepad++ is a free (free as in both "free speech" and "free beer") source code editor and Notepad replacement that supports several programming languages and natural languages. Running in the MS Windows environment, its use is governed by GPL License.

See the Notepad++ official site for more information.

Notepad++ Release Key

Since the release of version 7.6.5 Notepad++ is signed using GPG with the following key:

  • Signer: Notepad++
  • E-mail: don.h@free.fr
  • Key ID: 0x8D84F46E
  • Key fingerprint: 14BC E436 2749 B2B5 1F8C 7122 6C42 9F1D 8D84 F46E
  • Key type: RSA 4096/4096
  • Created: 2019-03-11
  • Expires: 2027-03-13

https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/nppGpgPub.asc

Supported OS

All the Windows systems still supported by Microsoft are supported by Notepad++. However, not all Notepad++ users can or want to use the newest system. Here is the Supported systems information you may need in case you are one of them.

Build Notepad++

Please follow build guide to build Notepad++ from source.

Contribution

Contributions are welcome. Be mindful of our Contribution Rules to increase the likelihood of your contribution getting accepted.

Notepad++ Contributors

Description
Notepad++ official repository
Readme GPL-3.0 407 MiB
Languages
C++ 79.4%
HTML 11%
C 2.8%
Objective-C++ 1.8%
Python 1.7%
Other 2.6%