[Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

Mariano Martinez Peck
Guys,

I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that it might now commit (if there wasn't an almost out of memory exception).
So I was thinking a variant that does:

commitOnAlmostOutOfMemoryDuring: aBlock

self almostOutOfMemoryStaticHandlerInstalled
ifTrue: [ ^aBlock value ].
[
self installAlmostOutOfMemoryStaticHandler: 75.
aBlock value.
                System commitTransaction.
 ]
ensure: [ self uninstallAlmostOutOfMemoryStaticHandler ]


Notice the added       System commitTransaction.

would that be useful ?

-- 
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

Richard Sargent
Administrator
>> I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that
>> it might not commit (if there wasn't an almost out of memory exception).

With a guaranteed commit, the name should be changed to reflect its intent. e.g. #commitDuringAndAfter: (not a very good name, but you get the idea)


On Fri, Dec 6, 2013 at 9:41 AM, Mariano Martinez Peck <[hidden email]> wrote:
Guys,

I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that it might now commit (if there wasn't an almost out of memory exception).
So I was thinking a variant that does:

commitOnAlmostOutOfMemoryDuring: aBlock

self almostOutOfMemoryStaticHandlerInstalled
ifTrue: [ ^aBlock value ].
[
self installAlmostOutOfMemoryStaticHandler: 75.
aBlock value.
                System commitTransaction.
 ]
ensure: [ self uninstallAlmostOutOfMemoryStaticHandler ]


Notice the added       System commitTransaction.

would that be useful ?

-- 
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass




--
Richard Sargent
Business Development Manager
503-766-4719
[hidden email]
GemTalk Systems
15220 NW Greenbrier Parkway #240
Beaverton, OR 97006

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

Mariano Martinez Peck



On Fri, Dec 6, 2013 at 2:51 PM, Richard Sargent <[hidden email]> wrote:
>> I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that
>> it might not commit (if there wasn't an almost out of memory exception).

With a guaranteed commit, the name should be changed to reflect its intent. e.g. #commitDuringAndAfter: (not a very good name, but you get the idea)

 
yes!
 

On Fri, Dec 6, 2013 at 9:41 AM, Mariano Martinez Peck <[hidden email]> wrote:
Guys,

I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that it might now commit (if there wasn't an almost out of memory exception).
So I was thinking a variant that does:

commitOnAlmostOutOfMemoryDuring: aBlock

self almostOutOfMemoryStaticHandlerInstalled
ifTrue: [ ^aBlock value ].
[
self installAlmostOutOfMemoryStaticHandler: 75.
aBlock value.
                System commitTransaction.
 ]
ensure: [ self uninstallAlmostOutOfMemoryStaticHandler ]


Notice the added       System commitTransaction.

would that be useful ?

-- 
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass




--
Richard Sargent
Business Development Manager
503-766-4719
[hidden email]
GemTalk Systems
15220 NW Greenbrier Parkway #240
Beaverton, OR 97006



--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

Dale Henrichs-3
In reply to this post by Richard Sargent
Sounds good ...


From: "Richard Sargent" <[hidden email]>
To: "Mariano Martinez Peck" <[hidden email]>
Cc: [hidden email]
Sent: Friday, December 6, 2013 9:51:49 AM
Subject: Re: [Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

>> I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that
>> it might not commit (if there wasn't an almost out of memory exception).

With a guaranteed commit, the name should be changed to reflect its intent. e.g. #commitDuringAndAfter: (not a very good name, but you get the idea)


On Fri, Dec 6, 2013 at 9:41 AM, Mariano Martinez Peck <[hidden email]> wrote:
Guys,

I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the drawback that it might now commit (if there wasn't an almost out of memory exception).
So I was thinking a variant that does:

commitOnAlmostOutOfMemoryDuring: aBlock

self almostOutOfMemoryStaticHandlerInstalled
ifTrue: [ ^aBlock value ].
[
self installAlmostOutOfMemoryStaticHandler: 75.
aBlock value.
                System commitTransaction.
 ]
ensure: [ self uninstallAlmostOutOfMemoryStaticHandler ]


Notice the added       System commitTransaction.

would that be useful ?

-- 
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass




--
Richard Sargent
Business Development Manager
503-766-4719
[hidden email]
GemTalk Systems
15220 NW Greenbrier Parkway #240
Beaverton, OR 97006

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass