473,396 Members | 1,846 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,396 software developers and data experts.

Multithreading multiple with processors

Do i need to use a special class if i need to code on computer with
multiple processors. I need to make sure that all of the CPU resources
are used to process the code. Is there a way to do this?
thank you,
Mars

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #1
2 1404
On 13 maio, 13:44, Victory <csh...@devdex.comwrote:
Do i need to use a special class if i need to code on computer with
multiple processors. I need to make sure that all of the CPU resources
are used to process the code. Is there a way to do this?
thank you,
Mars

*** Sent via Developersdexhttp://www.developersdex.com***
Hi Mars,

Well, in my opinion, I think multi-processor environment are managed
by the OS.
One thing you´ve to do is, contruct an multithreading application...
avoiding any kind of knowledge about how to access each processor, the
OS do it for you.

[]´s
Breno.
Jun 27 '08 #2
On Tue, 13 May 2008 09:44:06 -0700, Victory <cs****@devdex.comwrote:
Do i need to use a special class if i need to code on computer with
multiple processors. I need to make sure that all of the CPU resources
are used to process the code. Is there a way to do this?
That depends on what you mean. If you have only one thread in your
application, then you will only use one CPU.

If you have multiple threads, you will use at most as many CPUs as you
have threads. The OS will ensure that, if a CPU is available and you have
a thread that's runnable (that is, it's not waiting on something), the
thread will run. So generally speaking, the answer is: just make sure you
have enough threads ready to run to keep all the CPUs busy.

In practice, it can get very complicated, depending on your application,
but then you haven't really offered any details to allow a better answer.
Hopefully the above is enough to get you started.

Pete
Jun 27 '08 #3

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

Similar topics

5
by: Harold Howe | last post by:
Howdy, 1- Are property reads in effect volatile? Or is the compiler allowed to optimize property reads away? ie class foo { public int bar { get { return m_bar;}
47
by: mihai | last post by:
What does the standard say about those two? Is any assurance that the use of STL is thread safe? Have a nice day, Mihai.
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
4
by: boo73uk | last post by:
Hi All, I'm going to rewrite a VB6 app to VB.net and I need some pointers. Basically this app spawns simultaneous,multiple, independant ActiveX.exe 'workers' which query a SQL Server database and...
2
by: Pradnya Patil | last post by:
hi , I am trying to draw ' html div-tag ' on the screen which will resemble a rectangle through vb.net code. I want it to be drawn faster...so I introduced multithreading using Threadpool. I...
7
by: Ray | last post by:
Hello, Greetings! I'm looking for a solid C++ multithreading book. Can you recommend one? I don't think I've seen a multithreading C++ book that everybody thinks is good (like Effective C++ or...
20
by: S.Mohideen | last post by:
Hi Folks, Python is praised about - me too. But at one instance it fails. It fails to behave as a true multi-threaded application. That means utilizing all the CPUs parallely in the SMP...
16
by: WATYF | last post by:
Hi there... I have a huge text file that needs to be processed. At the moment, I'm loading it into memory in small chunks (x amount of lines) and processing it that way. I'd like the process to be...
2
by: d33a | last post by:
Hello! Can somebody give me a hint? I am trying to obtain the CPU usage for 2 processors (or more ) with active multithreading. i tried all methods - using the API and using the performance...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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.