Winstep

Software Technologies


 Winstep Forums


Print view
Board index : Winstep Forums : General Discussion  [ 28 posts ] Go to page Previous  1, 2
Author Message
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Fri Jan 05, 2018 6:35 am 
Offline

Joined: Wed Jan 03, 2018 4:50 pm
Posts: 11
Great... Can't wait to try out a new beta. :wink:


Back to top
 Profile  
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Wed Jan 10, 2018 6:10 pm 
Offline

Joined: Wed Jan 03, 2018 4:50 pm
Posts: 11
Any news about a new beta with the fix?


Back to top
 Profile  
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Wed Jan 10, 2018 8:54 pm 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
Almost there. :)

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Mon Jan 15, 2018 4:22 pm 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
bm81 wrote:
Any news about a new beta with the fix?


There is a new beta out. Please give it a try and let me know as soon as possible. :)

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Wed Jan 17, 2018 8:32 am 
Offline

Joined: Wed Jan 03, 2018 4:50 pm
Posts: 11
Thanks again for the new beta. It's "nearly" working now.

Issue: If i delete 10 or more items, it's not fixed.

If i delete 9 or less items it's fixed.
I tried 15 minutes to reproduce it, and always with the same results.


Back to top
 Profile  
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Wed Jan 17, 2018 12:57 pm 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
bm81 wrote:
Issue: If i delete 10 or more items, it's not fixed.

If i delete 9 or less items it's fixed.


What the...?! That doesn't make any sense lol

Does it matter the size of the items you delete?

Is the issue when deleting more than 9 items in the transition between empty and full states, in reporting the correct number of files in the recycle bin, or both?

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Wed Jan 17, 2018 1:55 pm 
Offline

Joined: Wed Jan 03, 2018 4:50 pm
Posts: 11
Yeah, its really weird.

As far as i can see the size doesn't matter. Tested small files and big ones and as well Empty folders.

10 items or more, recycle bin shows an empty icon and doesn't count items in trash (mouse over, tooltip says, zero items and no filesizes)


Back to top
 Profile  
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Thu Jan 18, 2018 10:36 pm 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
Ok, here is what I found out, but first a little background info:

There is no documented way to know when a file has been sent to the recycle bin or restored from it. There is, however, an API function (GetBitBucketCount) to know how many files are in the recycle bin and their total size.

So what is the problem? The problem is that Windows does not cache these values anywhere: *every time* you call this function *all* the files in the Recycle Bin are enumerated and their size retrieved, one by one.

That is the very reason the Windows Recycle Bin, unlike the Winstep Recycler module, does not tell you how many files are in the Recycle Bin and how much space they use when you hover the icon on the Desktop.

Now, if the Recycle Bin only has a handful of files in it, enumerating them all is really quick and not a problem. But some users have THOUSANDS of files in their Recycle Bin (some have TENS OF THOUSANDS of little files!). Enumerating them all and calculating their sizes can thus take a VERY long time.

So, this is something you ONLY want to do when ABSOLUTELY required.

Many years ago, in the very first versions of WorkShelf/Nexus, the application itself would call GetBitBucketCount at startup, so it could display the Recycle Bin module.

Result: on those systems with thousands of files in the Recycle Bin, the Winstep application would take a very long time to initialize because it was busy waiting for GetBitBucketCount to return. To make matters worse, this is the type of application you want to start with Windows - the Winstep application was triggering a very intensive disk operation at the worst possible moment: when the system was already very busy starting up, a time where everything else is also being loaded from disk. Talk about disk heads trashing all over the place.

A very full Recycle Bin would thus result in an excruciatingly slow boot time (and, more often than not, an uninstalled Winstep application).

In those times of naiveness, the Recycle Bin would also be polled every 30 seconds or so to see if the number of files in it had changed. And so every 30 seconds the application could stall for an undetermined period of time until the Recycle Bin function returned.

These problems were eventually solved by:

1. Not attempting to get the number of files in the Recycle Bin until the system has been up and running for at least 5 minutes (this prevents the Winstep application from being responsible for slowing boot times).

2. Outsourcing the actual counting of the files in the Recycle Bin to a separate Winstep applet, which then communicates the result to the main application. This prevents the application from stalling when GetBitBucketCount takes a long time to return.

3. Only polling the Recycle Bin when files have been added to or restored from it - this prevents the application from periodically trashing the disk.

This last part is the tricky part. Instead of polling, we rely on automatic shell notifications from the file system that something has changed - this way we don't waste time checking for changes until there *are* changes.

However, there is no shell notification specific to the Recycle Bin - so the application has to listen to ALL shell notifications (when files are deleted, renamed, etc...) and try to guess if that operation is related to the Recycle Bin or not. If it thinks so, it triggers a recount of the files in the Recycle Bin.

And here we run into another snag: since Windows handles its own Recycle Bin operations internally, Microsoft did not see a need to be consistent... what notification is sent when a file is deleted or restored can vary from version of Windows to version of Windows.

If this wasn't bad enough, as you just found out - and me too now - the notification will be different if you delete a couple or a bunch of files at the same time. For a handful of files, here on Windows 7 I can rely on the normal 'file has been restored' notification for each file restored from the Bin - but when I restore a bunch of files at once, Windows sends a single notification (SHCNE_UPDATEDIR), and it has nothing to do with the Recycle Bin itself, but with the User's Desktop. Go figure.

On Windows 7 I still get one 'file has been deleted' notification per file when I delete more than 10 files, but I guess Microsoft changed this behavior on Windows 10.

So, hopefully the changes I made now to also trigger a recount on receiving that User's Desktop notification will fix the issue - if not, I'm sorry but it will have to wait for the next version.

This wall of text is just for you to understand that things are not as simple as you probably thought they were (are they ever?).

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Fri Jan 19, 2018 6:25 am 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
Anyway, I tested several times deleting and restoring 14 files on Windows 10 and it worked every time.

Fingers crossed.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Sun Jan 21, 2018 5:47 am 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
So, did the official release finally fix the problem?

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Sun Jan 21, 2018 2:41 pm 
Offline

Joined: Wed Jan 03, 2018 4:50 pm
Posts: 11
Just tried out the new version. It looks like its working now like charm. Thank you very much.


Back to top
 Profile  
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Sun Jan 21, 2018 3:27 pm 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
bm81 wrote:
I really like your Software, but this behaviour annoys me and is preventing me from buying a licence for ultimate.

bm81 wrote:
Just tried out the new version. It looks like its working now like charm. Thank you very much.


Good. Now you have no more excuses. :)

There is even a promotion of Nexus Ultimate going on at this very moment. :P

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Trash reacts after many seconds or never
PostPosted: Fri Feb 02, 2018 3:50 pm 
Offline
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 8785
bm81 wrote:
I really like your Software, but this behaviour annoys me and is preventing me from buying a licence for ultimate. Maybe we could resolve this problem together. :D


Ok, I waited what I think is a reasonable amount of time before deciding to post the following:

This is exactly why I normally don't react well when someone states something along the lines of 'Oh I would buy your software if only it could do <x>'. 9 times out of 10 it's complete bull, they're just trying to manipulate you into giving them what they want.

Case in point: this user never returned to the forums once his problem was fixed. He didn't do what he implied he would either, not even when he could have done so at half price.

Please make no mistake: this rant is not about money - at all! - it's about attitude. I would have fixed this issue anyway once I became aware of it, but the user in question followed the whole process closely and had a pretty good idea how much time and work was spent fixing something that was irrelevant to 99.9% of users out there and only really bothered *him*.

His way of showing consideration? 'Thank you for all the fish, bye now!'

Entitled generation, indeed.

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
Post new topic Reply to topic Board index : Winstep Forums : General Discussion  [ 28 posts ] Go to page Previous  1, 2
Display posts from previous:  Sort by  

Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron