Re: Calling method/object reference

From: Jeff Harman (jeff.harman_at_sbcglobal.net)
Date: 02/28/05


Date: Mon, 28 Feb 2005 05:25:26 GMT

The reason I want to include a reference to the locking entity, is that I am
implementing a cache that allows items to be returned to active use
(unlocked) after a specific timeout. In that case, I don't want the
original holder of the lock potentially unlocking the valid lock of another
element. The method I had intended to use would use the calling reference
to act as a lock identifier. I wanted to make this transparent to the users
of the cache, hence my original question.

I certainly do not wish to use any sun.* packages, style, support, longevity
and documentation issues aside, I am working in an IBM JVM. I doubt that
they have implemented the SUN package hierarchy.

-Jeff

Remember: 1.79999x10^12 furlongs per fortnight, It is not just a good idea
it is the law.

"Stefan Schulz" <terra@spacetime.de> wrote in message
news:pan.2005.02.25.08.52.53.737733@spacetime.de...
> On Fri, 25 Feb 2005 05:31:51 +0000, Jeff Harman wrote:
>
>> I'm working on an object caching mechanism for j2se (1.4) and am trying
>> to
>> figure out how to determine either the:
>> Referencing (calling) method or
>> Calling Object
>>
>> Basically I want to silently lock an object in the cache (check out)
>> without
>> explicitly requiring the calling object to provide a reference.
>>
>> Any ideas?
>
> There is a sun.* method that does this, but as with nearly all sun.*
> classes, it is something you _would_ and _should_ not use. Besides, it is
> entirely undocumented. Also, i see precious little need for it. Why
> include locking / unlocking with the checkout / checkin code?
>
> --
> In pioneer days they used oxen for heavy pulling, and when one ox
> couldn't budge a log, they didn't try to grow a larger ox. We shouldn't
> be trying for bigger computers, but for more systems of computers.
> --- Rear Admiral Grace Murray Hopper
>



Relevant Pages

  • Re: string as lock key?
    ... you never know who else might have a reference to the same ... String s2 = new ... I'm still debating if you really need a lock here. ... multiple requests come in and don't find an entry in the cache. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: string as lock key?
    ... you never know who else might have a reference to the same ... String s2 = new ... I'm still debating if you really need a lock here. ... multiple requests come in and don't find an entry in the cache. ...
    (microsoft.public.dotnet.framework)
  • Re: How to do proper locking
    ... >> lock across malloc, so your allocation code isn't safe. ... while you bump the reference count, ... PROC_LOCKwhile doing crhold(). ... > - setting up timers. ...
    (freebsd-hackers)
  • Re: c# object caching and reference counting
    ... I need to cache various resource objects such as images for example, ... (wich could be considered documents for ease of discusion) ... I realy dont want to have to keep a track of seperate reference count as ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Load Testing Errors
    ... Another thing to check when you get null reference errors in an ASP.NET ... application, but ONLY under load, is whether the objects on which you're ... if (someObjectKey is in the cache) { ... lower volumes, then either your cache expires very frequently, or there is ...
    (microsoft.public.dotnet.framework.performance)