Jump to content
Sign in to follow this  
wuwuxin

Is Delphi's HTTPRIO thread-safe?

Recommended Posts

For a Web Service application,  I would like to create ONE global instance of HTTPRIO, then access it from different threads to invoke remote methods (of the same Web Service server). 

 

Is this safe, or any potential issues?

Share this post


Link to post
4 hours ago, Dalija Prasnikar said:

It is not thread safe. You cannot share one instance among threads.

Thank you Dalija.

 

Would it be OK to set the properties (e.g., WSDL URL) of HTTPRIO first, then share it among multiple threads?  These threads won't change it properties, just use it to access the Web Service.

Share this post


Link to post
54 minutes ago, wuwuxin said:

Thank you Dalija.

 

Would it be OK to set the properties (e.g., WSDL URL) of HTTPRIO first, then share it among multiple threads?  These threads won't change it properties, just use it to access the Web Service.

No. 

 

When you use it, even if you don't change the properties, there are other state (encapsulated data) changes happening and this is where multiple threads can interfere with each other.

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×