# Re: Thread safety for providers

Roland Schemers (Roland.Schemers@Eng)
Mon, 16 Jun 1997 14:01:40 -0700 (PDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: David Brownell: "Re: Thread safety for providers"
- Previous message: Steve Burnett: "Thread safety for providers"
- Maybe in reply to: Steve Burnett: "Thread safety for providers"
- Next in thread: David Brownell: "Re: Thread safety for providers"

    Date: Mon, 16 Jun 1997 14:01:40 -0700 (PDT)

    From: Roland Schemers <Roland.Schemers@Eng>

    Subject: Re: Thread safety for providers

    To: java-security@web2.javasoft.com, burnettS@RSA.COM

> >
> >As far as we know, Java has no straight-forward way of locking an object for
> >periods of time lasting longer than one method call. There are ways of having
> >a "mutex" object that is locked and unlocked by specific, proprietary
> >methods, but no specific Java programming practice has been defined.

The standard way of doing it is in a synchronized block like so:

synchronized (object) {
...
...
}

I assume though that you want something more like lock/unlock calls that
don't have to be done in the same block/method? As you mention, these
primatives can be built using a mutex object, but that can be cumbersome.
I'll let someone else comment on the JCE wrt to locking in general.

thanks, roland

> >
> >As far as we know, Java has no straight-forward way of locking an object for
> >periods of time lasting longer than one method call. There are ways of having
> >a "mutex" object that is locked and unlocked by specific, proprietary
> >methods, but no specific Java programming practice has been defined.
> >
> >Furthermore, the JCE will support an init-update-final type of API on
> >encryption objects, which seems to require the type of locking described
> >above if a provider's security package is to be thread-safe.
> >
> >What kind of requirements does Sun intend to place on the thread safety of
> >security packages, given that there is no accepted, standardized way of
> >locking objects for longer than one method call?
> >
> --Steve Burnett
> burnetts@rsa.com
>
> --Ben Adida
> > badida@rsa.com

- Next message: David Brownell: "Re: Thread safety for providers"
- Previous message: Steve Burnett: "Thread safety for providers"
- Maybe in reply to: Steve Burnett: "Thread safety for providers"
- Next in thread: David Brownell: "Re: Thread safety for providers"