• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How do I use 'idle time'. A needed fix for memory loss.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I use 'idle time'. A needed fix for memory loss.


  • Subject: How do I use 'idle time'. A needed fix for memory loss.
  • From: Brian Christmas <email@hidden>
  • Date: Fri, 16 Sep 2016 18:22:55 +1000

G’day

After trying to search for ‘idle’ and ‘ascobjc', I get ‘did not match any documents’. I did find ‘idle time’ under Cocoa, but I’ve never been able to wrap this old brain around converting from Cocoa to ascobjc.

I have absolutely no idea of what this does,  or how  to use it, but it sounds interesting.

If you have operations that can be deferred or broken into chunks and performed incrementally, doing so can help performance. Operations that are iterative or modular in nature, such as scratch calculations, can usually be performed in small chunks. By performing a few of these calculations at idle time using asynchronous notifications, you can avoid blocking your main thread. To register for idle time notifications, you would simply post a notification object to the default queue and ask for it to be dispatched at idle time, as shown in the following example:
NSNotification* myNotification = [NSNotification notificationWithName:@"MyIdleNotification" object:myIdleHandlerObject];
 
[[NSNotificationQueue defaultQueue] enqueueNotification:myNotification postingStyle:NSPostWhenIdle];
Timers offer another way to do small amounts of work at more regular intervals. The advantage of timers is that they fire at a known time. The disadvantage is that they fire regardless of how busy your application is, which could still cause a perceptible delay. For information on how to set up a timer, see Timer Programming Topics. 
What I’ve been using, which seems responsible for the memory loss, is,

# my performSelector:"runningLoop:" withObject:(missing value) afterDelay:mailManagerDelay


What I NEED, in vanilla Applescript,but converted to ascobjc, is…

on |idle|()
  if not my reStartMM then
initializingRoutinesThree(my reStartMM)
else
my runningLoopInitializer()
end if
end |idle|

Isanyone prepared to advise me on how I can use idle time in ascobjc, please.

And Shane, I’ve tried looking through this lists records, but for the life of me evry time I’ve tried, and can’t fing any way of searching them. And I’ve tried a bloody lot of times over the years, bbut given iup in frustration.

Regards

Santa

And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Memory usage: Report from 'Instruments'
  • Next by Date: "Cannot save C and Objective C pointers in script"?
  • Previous by thread: Memory usage: Report from 'Instruments'
  • Next by thread: "Cannot save C and Objective C pointers in script"?
  • Index(es):
    • Date
    • Thread