473,395 Members | 1,885 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.

LiteralControl thread safety.

Hi.

I have template solution. The Base page creates the main skeleton for the
page.

For that it adds bunch of LiteralControls in run time.

I am thinking of creating those controls only once(during initialization)
and then just add them to control collection.

I realize that every instance of the page will use the same instance of the
LiteralControl but since they only have static text i think it will be OK
and will save me some CPU ticks.

Is it ok? Any problem with this approach?

Thanks.
George.
Nov 18 '05 #1
2 1284
Hi, George,

It will be easier to answer your question if you post some code.

Basically, everything that is not static (in VB shared) or constant field
gets created for each instance of the class. With the inheritance you avoid
writing the same code many times, but the code gets executed anyway.

Greetings
Martin
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ur*************@TK2MSFTNGP10.phx.gbl...
Hi.

I have template solution. The Base page creates the main skeleton for the
page.

For that it adds bunch of LiteralControls in run time.

I am thinking of creating those controls only once(during initialization)
and then just add them to control collection.

I realize that every instance of the page will use the same instance of the LiteralControl but since they only have static text i think it will be OK
and will save me some CPU ticks.

Is it ok? Any problem with this approach?

Thanks.
George.

Nov 18 '05 #2
Hi, George,

It will be easier to answer your question if you post some code.

Basically, everything that is not static (in VB shared) or constant field
gets created for each instance of the class. With the inheritance you avoid
writing the same code many times, but the code gets executed anyway.

Greetings
Martin
"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:ur*************@TK2MSFTNGP10.phx.gbl...
Hi.

I have template solution. The Base page creates the main skeleton for the
page.

For that it adds bunch of LiteralControls in run time.

I am thinking of creating those controls only once(during initialization)
and then just add them to control collection.

I realize that every instance of the page will use the same instance of the LiteralControl but since they only have static text i think it will be OK
and will save me some CPU ticks.

Is it ok? Any problem with this approach?

Thanks.
George.

Nov 18 '05 #3

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

Similar topics

4
by: Jonathan Burd | last post by:
Greetings everyone, Here is a random string generator I wrote for an application and I'm wondering about the thread-safety of this function. I was told using static and global variables cause...
9
by: Alexander Fleck | last post by:
Hi, I' ve to make a software module thread safe. I know how to realize that and what' re the main topics of thread safety. But I don' t know how thread safety can be tested. I read about a test...
4
by: The Crow | last post by:
for example i have static readonly SqlParameter and i want to clone them at runtime. as clone operation will not write to SqlParameter object, just reading, should i lock that object during read...
1
by: George Ter-Saakov | last post by:
Hi. I have template solution. The Base page creates the main skeleton for the page. For that it adds bunch of LiteralControls in run time. I am thinking of creating those controls only...
22
by: Brett | last post by:
I have a second thread, t2, that errors out and will stop. It's status is then "Stopped". I try to start t2 from thread 1, t1, by checking If t2.threadstate = "Stopped" Then t2.start() ...
4
by: Warren Sirota | last post by:
Hi, I've got a method that I want to execute in a multithreaded environment (it's a specialized spider. I want to run a whole bunch of copies at low priority as a service). It works well running...
6
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it...
1
by: paul.hester | last post by:
Hi all, All of the classes in my DAL are static, with constants defining the stored procedures and parameters. I've been having some problems with my site which makes me wonder if there's a...
13
by: arun.darra | last post by:
Are the following thread safe: 1. Assuming Object is any simple object Object* fn() { Object *p = new Object(); return p; } 2. is return by value thread safe?
0
by: Graham Wideman | last post by:
Folks: Can anyone tell me what controls php's "thread safety" feature? I have an installation where phpinfo() is showing Thread safety: enabled, whereas I need it disabled in order to work...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.