473,839 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relation between Tread Vs RAM Vs CPU

Hi,

I have two questions,

First, does anybody know how to quantify the relation between the number
of threads, the amount of RAM and the CPU power?

Secondly, does a System.Threadin g.Timer is lighter in used ressources
than using a thread ? why? Does it start/stop faster than a thread ? why?

This is very technical but I can't find ressource about that
specifically, if you have any web references, I would very appreciate.

Best regards,
Marty
Nov 17 '05 #1
3 1730
Marty,

What kind of relation are you looking for? You can't say the OS can
handle X number of threads based on the amount of ram and CPU, or anything
of that nature. The best you can do is guess, and you also need a good deal
more information to make that guess anywhere close to accurate.

As for using a Timer instead of a thread, both do different things. The
timer will fire a notification after a certain period of time has elapsed.
A thread is a unit of execution which will be performed separately from
other threads. They have different purposes, so I am not quite sure what
your question is.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Marty" <xm******@hotma il.com> wrote in message
news:iFese.6375 5$9A2.7176@edtn ps89...
Hi,

I have two questions,

First, does anybody know how to quantify the relation between the number
of threads, the amount of RAM and the CPU power?

Secondly, does a System.Threadin g.Timer is lighter in used ressources than
using a thread ? why? Does it start/stop faster than a thread ? why?

This is very technical but I can't find ressource about that specifically,
if you have any web references, I would very appreciate.

Best regards,
Marty

Nov 17 '05 #2
Hi Nicolas,

Thank you for your reply, I'll add more details to my query.

For my first question, I want to write some software specification and I
need to know if the number of threads will make increase the amount of
used RAM by the application.
-If I have 50 running threads (one thread for each client connection in
a server), how can I theorically evaluate the performance impact of that
on the system (at least RAM)?
-Does Microsoft can guaranty a specific amount of RAM per thread? (just
the thread object itself idling).

For my second question, I'll explain what I am doing right now.
1- A client connect to the server.
2- The server accept the connection and create a thread that will handle
this new client connection.
3- The thread will pool a queue created for that client.
4- When server sends messages to client, messages are firstly queued in
this queue (the flow is heavy, 100-1000 message per sec. (each msg = up
to 100bytes)
5- The thread will dequeue each message in the queue and send it to the
client through the socket.
6- When the thread dequeued all pending message, it sleep for 10ms.
7- Then thread awake and check if there is message to send to client.
Then do step 5, 6, 7 until the client disconnect or the server is closed.

The server can handle case 1 to 7 for 50 clients. Each client connection
has its own thread that has its own queue. Each client does not receive
the same message from the server.

Should I use a thread.timer instead of the current thread for step 1 to
7 to dequeue, in order to get full speed/performance of the server ?
Maybe the thread.timer will start/stop faster than the thread.sleep()?

I appreciate your suggestion.
Marty
Nicholas Paldino [.NET/C# MVP] wrote:
Marty,

What kind of relation are you looking for? You can't say the OS can
handle X number of threads based on the amount of ram and CPU, or anything
of that nature. The best you can do is guess, and you also need a good deal
more information to make that guess anywhere close to accurate.

As for using a Timer instead of a thread, both do different things. The
timer will fire a notification after a certain period of time has elapsed.
A thread is a unit of execution which will be performed separately from
other threads. They have different purposes, so I am not quite sure what
your question is.

Nov 17 '05 #3
at
Quantify what aspect? I take it you are thinking about thru-put, right?

Then in relative terms a quantification could be that more ram and more cpu
power allow for more threads.

That quantification is not complete and maybe even wrong but I think you
better switch to what you are actually trying to achieve. You can spend an
infinite amount of time trying to quantify the universe but your time is
limited. If you want to get work done, focus on that instead. You might get
better answers to your question as an added bonus.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:OI******** ******@TK2MSFTN GP09.phx.gbl...
Marty,

What kind of relation are you looking for? You can't say the OS can
handle X number of threads based on the amount of ram and CPU, or anything
of that nature. The best you can do is guess, and you also need a good
deal more information to make that guess anywhere close to accurate.

As for using a Timer instead of a thread, both do different things.
The timer will fire a notification after a certain period of time has
elapsed. A thread is a unit of execution which will be performed
separately from other threads. They have different purposes, so I am not
quite sure what your question is.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Marty" <xm******@hotma il.com> wrote in message
news:iFese.6375 5$9A2.7176@edtn ps89...
Hi,

I have two questions,

First, does anybody know how to quantify the relation between the number
of threads, the amount of RAM and the CPU power?

Secondly, does a System.Threadin g.Timer is lighter in used ressources
than using a thread ? why? Does it start/stop faster than a thread ?
why?

This is very technical but I can't find ressource about that
specifically, if you have any web references, I would very appreciate.

Best regards,
Marty


Nov 17 '05 #4

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

Similar topics

0
2137
by: Andreas | last post by:
Hi folks, how would you design a 1:1 relation ? I'd like to split an entities's attributes because they won't get equally frequently requested. So I can save memory and disk access time. The integrity of the splitted record should be retained. The key points would be:
3
11397
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when building the database: 3:ERROR: table "country" does not exist 6:ERROR: table "customer" does not exist 11:ERROR: table "product" does not exist 15:ERROR: table "license" does not exist 19:ERROR: table "enduser" does not exist 24:ERROR: ...
6
1635
by: Brian Henry | last post by:
Here's an example of the code.. I have two combo boxes on screen that when one's selection is change the other's items will be updated to reflect the change (based on a relation) Private ds_formData As New DataSet ' ' Fill Line Of Business ' cmd_selectCommand.CommandText = "BENESP_GetLinesOfBusiness" da_formData.FillSchema(ds_formData, SchemaType.Source, "LinesOfBusiness")
5
2632
by: Corno | last post by:
Hi all, If I want to provide a typed dataset from a webservice and if that dataset has relations that are nested (isNested=True), then the relations(keyrefs) are not available in the XSD that is offered. If I set IsNested to false or default, then it is included in the XSD. Is this a bug or by design? Corno
7
2745
by: Juris Krumins | last post by:
I have a problem with postgresql tables. periodicaly, I would say frequently about 5-10 time per hour i have such errors in my server log file: 2004-04-14 12:23:32 ERROR: cache lookup of relation 149064743 failed 2004-04-14 12:23:32 ERROR: Relation "tmp_table1" does not exist 2004-04-14 12:23:32 ERROR: Relation "tmp_table1" does not exist So turn on debugging options and have that's what i got:
0
2916
by: Ambica Jain | last post by:
I have a data grid called Files, which has some columns like FileName, Col1, Col2, ... , Col8. Then i have a combobox which allows user to select from Col1 to Col8 and based on this selection, i generate a report from data in grid Files. It displays like (e.g. is Col1 is selected): Col1 Count ---------------------- Val1 x Val2 y .....
1
2822
by: Tim Kelley | last post by:
I have two tables that are linked by 2 fields (ID1 and ID2). Is it possible to create this relation once the tables are in a DataSet? I can create a relation using a single field, but I don't know if this is possible with multiple fields. Thanks,
4
5119
bugboy
by: bugboy | last post by:
I'm inserting a new word into table 'w' and a definition into table 'c' which are linked in table 's' which is the relation table for the many to many relationship between 'w' and 'c'. I've been passed 2 variables from a form; $word and $def and i'm inserting them ok but i'm having trouble getting and passing on their ID's in order to insert them into the relation table 's' I've checked every query and they all work individually, so i...
9
1540
by: Miro | last post by:
VS2008 I have created 3 tables. Vendors Customers PhoneNumbers each have their own key Vendor has: VendorID - int unique identifier Customer has: CustomerID - int unique identifier
0
9856
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10910
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10589
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9426
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7833
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4493
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4066
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.