473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

repost: threading architecture approaches for a shared object, multiple opinions desired

I'm have a class that represents shipping cost data for a commerce web site.
The underlying data may only change once a month, maybe less, so I'd rather
not hit the database every time the class is needed.

My concerns are these:

I want it to be thread-safe for any number of simultaneous sessions.

I want it to be efficient-- is making one object available to potentially
hundreds of simultaneous sessions an inefficient approach?

When that infrequent update happens, how can I dereference and
re-instantiate the object based on the new data without fear of messing with
threads that are currently using it?

Any insights are appeciated. Thanks.

--Jon

P.S. Hey Microsoft folks! Threading is such a complex issue, and .NET makes
it new territory to all us folks coming from VB6... I bet a
microsoft.public.dotnet.threading newsgroup would be much appreciated.


Jul 19 '05 #1
1 1576
And it's a complex answer. I would recommend a COM
object using object pooling. You can have a separate app
that can notify the COM object that data has changed
(through a COM subscription) and the original object can
refresh its data from the database without
reinstantiation.

GL,
Sandy

-----Original Message-----
I'm have a class that represents shipping cost data for a commerce web site.The underlying data may only change once a month, maybe less, so I'd rathernot hit the database every time the class is needed.

My concerns are these:

I want it to be thread-safe for any number of simultaneous sessions.
I want it to be efficient-- is making one object available to potentiallyhundreds of simultaneous sessions an inefficient approach?
When that infrequent update happens, how can I dereference andre-instantiate the object based on the new data without fear of messing withthreads that are currently using it?

Any insights are appeciated. Thanks.

--Jon

P.S. Hey Microsoft folks! Threading is such a complex issue, and .NET makesit new territory to all us folks coming from VB6... I bet amicrosoft.public.dotnet.threading newsgroup would be much appreciated.

.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Jane Austine | last post by:
As far as I know python's threading module models after Java's. However, I can't find something equivalent to Java's interrupt and isInterrupted methods, along with InterruptedException....
17
by: Andrae Muys | last post by:
Found myself needing serialised access to a shared generator from multiple threads. Came up with the following def serialise(gen): lock = threading.Lock() while 1: lock.acquire() try: next...
4
by: Mike | last post by:
Please help this is driving me nuts. I have 2 forms, 1 user class and I am trying to implement a singleton class. Form 1 should create a user object and populate some properties in user. Form2...
4
by: Bob | last post by:
- For cleanup, is it sufficient to set a Thread to Nothing after it's done? - It is OK to pass objects out of the thread? (dumb question maybe but I want to be sure) - What's the best way to...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
2
by: Jon Sequeira | last post by:
I'm have a class that represents shipping cost data for a commerce web site. The underlying data may only change once a month, maybe less, so I'd rather not hit the database every time the class is...
0
by: Craig Buchanan | last post by:
I am building an application to help researcher record the outcomes of their studies. These outcomes are document across a number of paper forms. The information documented on these forms varies...
14
by: Simon Verona | last post by:
I think I'm doing this wrong : I have a class with a public shared method such as follows: public shared sub myFunction dim frm as new myFrm dim t as new Threading.Thread(Addressof ...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.