|
That's why those servers don't run on Windows; it does not let you hog the machine using a few threads. It's the OS that manages them, and under Windows, all threads are equal.
If it weren't, then some software-vendors that are known to put their apps in the startup-folder would try to have exclusive access to a core, just to have a "fast application".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
With that many threads your CPU/OS will be overloaded just trying to control and switch them. A very bad idea.
Veni, vidi, abiit domum
|
|
|
|
|
Foothill wrote: I am worried about some threads not getting any CPU time Why? Open the task-manager, and see how many threads are running in the various apps on your system. My browser is aleady above 30, with me having opened 3 tabs.
Windows decides "when" a thread gets put on a core, and how much time it'll get. Unless you muck with their priorities, they'd be equally important.
Foothill wrote: not to mention synchronization. Works the same as with 30 threads.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You have obviously never worked as a TA, thirty is a hard-codeable number : )
Eddy Vluggen wrote: Works the same as with 30 threads.
|
|
|
|
|
I am looking for documentation for how to have 50+ threads running under a single process in a high throughput application and not have threads be starved. Synchronization would be handled through design. I would like to be able to take multithreading and parallelism to their logical limits.
|
|
|
|
|
"Multi-threading and parallelism to their logical limits"
Then think (literally) outside the box. Taking something "to its limit" is a REALLY poor design...
The newest and greatest parallel processing architecture is distributed processing, using agents on multiple machines (boxes), with a master delegating work. This way you really can have the best of both worlds, throughput, millions of processed data items per second, etc. SETI@home has been doing this since early 2000's, and the concept is catching on. Either you can create a processing farm and not push a machine to its limit, or you can create some kind of public distributed processing system and let people with free idle-time (and even better, free electricity and equipment) do your processing for you.
|
|
|
|
|
First, what makes you think that the number of threads you launch is going to do the job?? Without the cores to support that many, you're just wasting resources and killing throughput, not improving it.
You have to find out what the domain of the problem is first. Why are you launching threads? What causes one thread to take so long processing a single record? Is it a compute-bound problem? Or is it an I/O problem where the thread is stalled, waiting for an I/O operation to complete??
Without knowing the exact causes of the delays in processing a record, throwing threads around will get you nowhere fast. You can throw threads at a stack of records, but if there are not enough cores or enough I/O throughput to run those threads you'll get no benefit. You may have to add hardware to solve the problem, not threads.
But, this is going to take a ton of research to figure out.
|
|
|
|
|
The problem I am trying to address, to start with, is how some of our developers continue to use SQL and Oracle as an application and not for data storage as it was intended. I've seen these immensely complicated SQL statements they have written which is a horrible programming practice and was looking for solutions using modular programming and parallelism. The problem is processing 4 million records in 45 different ways but quickly and efficiently. There are no real problems yet and I stress yet. So far their solution to slow processing is to throw more hardware at it and not increase the efficiency of the actual application.
|
|
|
|
|
Well, you're screwed before you even being.
No amount of hardware or threading or anything other than going back and redesigning and reworking that pile of crap is going solve the problem. You cannot fix bad design with anything, other than redesign.
You can throw all the threads you want at the problem, but they'll all just end up sitting idle waiting the SQL to process. Sure, your application will be starting hundreds of threads, but the SQL server will not be matching you. It'll spin up only what it can work with and will queue up any work it can't readily get to.
|
|
|
|
|
Foothill wrote: All suggestions are appreciated.
It isn't about the threads. It is about the work.
If you have 30 threads querying remote networks is significantly different than having 30 threads working on matrix computations based on in memory data.
Both of those are impacted if you are attempting to run the 'application' on a server that is already running other 'applications'.
And all of that is dependent on whether you do everything correctly. Messing up a single sync and you will suddenly have an application that is running slower than a single threaded app. Or deciding that an optimal solution which completely ignores the bandwidth limits of the network.
|
|
|
|
|
What I am working toward is more of an assembly line approach to some complex financial transactions. Some of my other replies to other posts under this topic will help give a better idea of what I am working toward. This project is testing the feasibility of creating truly modular programming, which is not creating new modules for an existing program and recompiling but passing code changes into an already running program and the code changes are applied without the program missing a beat. In a sense, it would end up a process that would never have to be restarted and processes constantly.
|
|
|
|
|
Foothill wrote: it would end up a process that would never have to be restarted and processes
constantly.
That doesn't really have anything to do with threading however. At least not in the context of what you suggested in your original post.
|
|
|
|
|
<itemtemplate>
<asp:Label ID="ProductPromotionLabel" runat="server"
Text='<%# string.Concat("RM ",Eval("ProductPromotion")) %>'
/>
</ItemTemplate >
how to get the data on productoromationlabel?
|
|
|
|
|
loop through the records in the DataList and search for the Label on the row with the FindControl method
MSDN FindControl[^]
Edit: This is an ASP.Net question. Please use the appropriate forum in the future.
|
|
|
|
|
Control myControl1 = FindControl("ProductPromotionLabel");
if (myControl1 == null)
{
myControl1.Visible = false;
}
thx it work but why cant set to visible it occur error
System.NullReferenceException: Object reference not set to an instance of an object.
|
|
|
|
|
MichaelCheong89 wrote: if (myControl1 == null) In order to prevent an Object reference error, you need to change this to a != null test instead.
|
|
|
|
|
yeah. pretty pointless to check if it's null and then trying to perform an action on it
|
|
|
|
|
You need to call the FindControl on the correct Control.
If you have a DataList as you said you first need to find the correct record. Example
foreach(var item in MyDataList.Items) {
var myLabel = item.FindControl("ProductPromotionLabel");
if(myLabel !=null) {
myLabel.Visible = false;
}
}
FindControl doesn't consider nesting. The easiest way is to set a breakpoint and look for at the Page with its Controls hierarchy.
|
|
|
|
|
ok thx ^^
|
|
|
|
|
how to remove the image button border? when i click on the button it will display the border such as image below.
it does't work when i set the border to none
<asp:ImageButton ID="ImgTop" style="border:none" text="Image not display" runat="server"
ImageUrl='<%# "ShowImgMan.ashx?ProductID=" + Eval("ProductID") %>' Width="195px" Height="190px" />
|
|
|
|
|
|
thx
|
|
|
|
|
|
I have 1 exercise for separate compound color planes green, red, blue. please help me
|
|
|
|
|
Help you with what? You haven't actually asked a question.
|
|
|
|