Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
devourment77 said:it is hard to go back... at least until there is dual core cpus
Very true.defakto said:I state a general rule of thumb is if you don't know what smp is or how it works, you don't need it.
Not designed for gaming, and that is not the primary purpose in my system. But they do nicely thoughAMDXPCottonFire22 said:I didnt think opterons where for gaming...
Well, they were intended as server/workstation chips. But think of it this way:AMDXPCottonFire22 said:I didnt think opterons where for gaming...
The huge cache makes for nice gaming, as well as simultaneous execution of GFX and physics threads in games that support it.zandor said:Well, they were intended as server/workstation chips. But think of it this way:
The original socket 940 Athlon FX was really just a fast Opteron, and the P4 EE is basically a fast Xeon core in P4 packaging.
M11 said:The huge cache makes for nice gaming, as well as simultaneous execution of GFX and physics threads in games that support it.
I strongly disagree with that statement!!devourment77 said:<snip> Once you go dually, it is hard to go back... at least until there is dual core cpus
Tim_axe said:Windows only lets one thread use up to 50%, or one full processor. So to acturally use 100%, or both processors, you need at least two programs going, or a multithreaded program.
defakto said:The os will move processes from one process to another as those processes
The move isn't based on "power" requirements. The moves are based on a thread being runnable.defakto said:need more power, or if they are using less. I'm not sure how it does it,
defakto said:but i do know that you can create an instability by setting an a processor affinity at time.
defakto said:A single process, like a game cannot use more than 1 processor, so it will never be able to use more than 50 percent of the total cpu usage in teh system,
defakto said:Mikeblas, actually you're [sic] statement is false.
defakto said:There is one game on the market that support SMP that i know of,
defakto said:if you just run a thread arbitrarily on another processor you're going to hit some issues.
#include <stdio.h>
#include <tchar.h>
#include <process.h>
#include <math.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
volatile LONG g_lCandidate = 3;
volatile bool g_bQuit = false;
class CThreadInfo;
unsigned int __stdcall ThreadProc(void* pInfo);
class CThreadInfo
{
public:
CThreadInfo()
{
m_hThread = NULL;
m_szName[0] = 0;
}
~CThreadInfo()
{
if (m_hThread != NULL && m_hThread != INVALID_HANDLE_VALUE)
CloseHandle(m_hThread);
}
HANDLE Create(int nName)
{
wsprintf(m_szName, "Thread%d", nName);
m_hThread = (HANDLE) _beginthreadex(NULL, 0, ThreadProc, this, 0, NULL);
return m_hThread;
}
char m_szName[100];
HANDLE m_hThread;
};
unsigned int __stdcall ThreadProc(void* pvParam)
{
CThreadInfo* pInfo = (CThreadInfo*) pvParam;
while (!g_bQuit)
{
// get a candidate to test
LONG lCandidate = InterlockedIncrement(&g_lCandidate);
if ((lCandidate & 1) == 0)
{
// it's even, and so it is certainly not prime
continue;
}
// it's odd, so it might be prime
LONG lUpperLimit = (LONG) sqrt((double)lCandidate);
bool bIsPrime = true;
for (LONG lDivisor = 3; lDivisor < lUpperLimit; lDivisor += 2)
{
if (lCandidate % lDivisor == 0)
{
bIsPrime = false;
break;
}
}
if (bIsPrime)
{
// printf("%s: %d is prime\n", pInfo->m_szName, lCandidate);
}
}
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
// did we get a parameter?
if (argc != 2)
{
printf("usage:\n\tThreadPrime <number_of_threads>\n\n");
return 1;
}
// was it a useful parameter?
int nThreads = atoi(argv[1]);
if (nThreads > 64 || nThreads < 1)
{
printf("can't create %d threads\n", nThreads);
return 1;
}
// create all the threads
CThreadInfo* infos = new CThreadInfo[nThreads];
for (int nIndex = 0; nIndex < nThreads; nIndex++)
{
if (INVALID_HANDLE_VALUE == infos[nIndex].Create(nIndex))
{
printf("Couldn't create thread %d\n", nIndex);
g_bQuit = true;
break;
}
}
// if we created them, wait for keyboard input to shut 'em down
if (!g_bQuit)
{
while (!_kbhit())
Sleep(0);
}
// ask the threads to quit running
g_bQuit = true;
// then wait for them to quit running.
// we need an array of handles to wait on
HANDLE* hWait = new HANDLE[nThreads];
memset(hWait, 0, sizeof(HANDLE) * nThreads);
DWORD dwWaitCount = 0;
for (int nIndex = 0; nIndex < nThreads; nIndex++)
{
if (infos[nIndex].m_hThread != NULL)
{
hWait[dwWaitCount] = infos[nIndex].m_hThread;
dwWaitCount++;
}
}
printf("Waiting for shutdown...");
DWORD dwDisposition = WaitForMultipleObjects(dwWaitCount, hWait, TRUE, 10000);
printf(" wait returned %d\n", dwDisposition);
// done waiting, so remove the array
delete [] hWait;
// no more threads, so close all their handles and free that memory
delete [] infos;
return 0;
}
defakto said:I'm not a coder at all, however, when trying to compile with DevC++ i get invalid on line 51.
defakto said:What are you refering to when you say simultaneous execution of GFX and physics threads in games that support it? Are you refereing to a dual system? or a single? If you're refering to a dual processor system, no game yet official has efficient support for smp processing, q3 had smp but support but it offered almost no increase and was usually a decrease.
defakto said:That's not quite an accurate statement. A thread can never use more than one processor, windows or not, you would need multiple threads to use more than one. Wether you're talking a windows, vax vms, or an IBM AS400, a thread cannot run on more than one processor at a time.
lynxlynx said:ok so is there a way to put certain processes in a dedicaded cpu?
like say I put all my system stuf in cpu 0 and the rest(lets say a game) in cpu 1 ?
talking about XP here or windows in general....
would not that be better for perfomance? to give the choosen process a "empty" cpu to use all by it self?
Leright said:I think you need to read his post again. Nothing he said was inaccurate. He never said one thread could use both processors....
Leright said:also, windows allows you to do this too, but it's not quite as easy and it doesn't work as well.
mikeblas said:Even if I had, would I have been incorrect?
Certainly, the same thread doesn't execute on two different processors simultaneously. But a single thread might be scheduled for one quantum on one processor, then scheduled on another processor for its next time slice.
.B ekiM