473,322 Members | 1,473 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,322 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 1568
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.