473,467 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create 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.Threading.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 1716
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.com
"Marty" <xm******@hotmail.com> wrote in message
news:iFese.63755$9A2.7176@edtnps89...
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.Threading.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.com> wrote in
message news:OI**************@TK2MSFTNGP09.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.com
"Marty" <xm******@hotmail.com> wrote in message
news:iFese.63755$9A2.7176@edtnps89...
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.Threading.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
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....
3
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...
6
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...
5
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...
7
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...
0
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...
1
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...
4
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...
9
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
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
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
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
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...
1
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
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.