You are viewing a plain text version of this content. The canonical link for it is here.
Posted to imperius-user@incubator.apache.org by Reza Asadollahi <ra...@uwaterloo.ca> on 2008/07/02 16:09:06 UTC

RE: Is Java_SPLPolicyRuleProvider thread safe?

Hi Naidu,
Thanks for the reply. 
So, at this time I put JSPL calls in a synchronized block. Please let me
know when you make it thread safe. 

Thanks
Reza

-----Original Message-----
From: Naidu G Javvadi [mailto:njavvadi@in.ibm.com] 
Sent: June 29, 2008 1:06 PM
To: imperius-user@incubator.apache.org
Subject: Re: Is Java_SPLPolicyRuleProvider thread safe?

Hi
  Java_SPLPolicyRuleProvider is not thread safe.Yes, it is good practice to
have only one instance of it rather than having multiple objects(which can
result to performance related problems).We can have synchronized block for
its methods such that they can be thread safe.



 Thanks & Regards,
 Naidu
 System Software Engineer.

 IBM India pvt ltd
 India Software Lab, IBM Software Group
 Embassy Golf Links, 4th Floor, 'B' Wing, Bangalore
 Phone:+91-80-41055471
 e-mail:njavvadi@in.ibm.com


                                                                           
             "Reza Asadollahi"                                             
             <rasadoll@uwaterl                                             
             oo.ca>                                                     To 
                                       <imperius-user@incubator.apache.org 
             28/06/2008 01:25          >                                   
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             imperius-user@inc         Is Java_SPLPolicyRuleProvider       
             ubator.apache.org         thread safe?                        
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi,

Is the instance of Java_SPLPolicyRuleProvider thread safe? I mean, if we
have only one instance of this class, can we use it safely in different
threads for creating or executing policies?

Is it a good practice to have only one instance? or it's better to have
several instances in a multi-threaded program (one per thread), or having
one instance in the program and use synchronize block for its method calls.



Thanks,

Reza