|
Hi,
My application is having two threads. One is UI thread doing all UI operations. The another thread is doing some heavy work like writing to disk. How I can achive that only when the system have a light load then only the disk writer thread will run and in heavy load cases it will not schedule or scheduled for very low time?
How can I know that when system is not heavily loaded and when it is heavily loaded?
Is the "Load Balancing" word correct here or it is misleading?
Regards,
Hemant.
|
|
|
|
|
I don't know that you can perform load-balancing as directly as you want to. However, the Windows API offers the 'CreateThread()' and 'SetThreadPriority()' functions, which allow you to create a thread and set its priority. For example, we can create a thread and set its priority to LOW, in which case the operating system will AUTOMATICALLY schedule the thread for execution in such a way that other, higher priority threads will receive more CPU cycles.
This is probably the best way to handle this anyway, as the operating system can allocate CPU cycles more efficiently that you could.
In your example, the disk writer thread would be given a low priority. As other tasks are invoked, such as user interface actions, Windows will automatically suspend the desk writer thread and give priority to the user interface.
Check out the documentation on 'CreateThread()' and 'setThreadPriority()' for a better description.
Scott
|
|
|
|
|
I am having one MFC application ,which is also having one ATL interface.
when I am running this application standalone there is only one instance of application and it is fine.
But if my this EXE is already running and any clients wants to access interface provided by this exe , then there will be two instances of same exe running, I want to avoid it.
What i have done is I have registered this exe with ROT,and when client wants some interface provided by this exe,itcan get it from ROT, but I am facing the problems in getting the appropiate interface from ROT
any help....
RahulB2C
|
|
|
|
|
Dear All,
I need to do that taking files from remote host using CFileDialog.
Can i use CFileDialog for getting file lists from remote host ?
How can i do this ?
Thanks.
Bye.
|
|
|
|
|
Sakthiu wrote: Can i use CFileDialog for getting file lists from remote host ?
The same way you would for a local host. What problem are you having? What does your code look like?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i want to know the total amount of time taken ,when control enters a funtion and leave.Is there any tool to know it.I am using visual studio 2005 professional edition.Is there any third party tool to know it.
Thanks in before
James
|
|
|
|
|
Hi
Use GetTickCount(). This might be helpful for you.
Bye
|
|
|
|
|
|
hi every one
how can i get process parent without using from PROCESSENTRY32 structure?
|
|
|
|
|
ULONG_PTR GetParentProcessId()
{
ULONG_PTR pbi[6];
ULONG ulSize = 0;
LONG (WINAPI *NtQueryInformationProcess)(HANDLE ProcessHandle, ULONG ProcessInformationClass,
PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength);
*(FARPROC *)&NtQueryInformationProcess =
GetProcAddress(LoadLibraryA("NTDLL.DLL"), "NtQueryInformationProcess");
if(NtQueryInformationProcess){
if(NtQueryInformationProcess(GetCurrentProcess(), 0,
&pbi, sizeof(pbi), &ulSize) >= 0 && ulSize == sizeof(pbi))
return pbi[5];
}
return (ULONG_PTR)-1;
}
Napalm
Napalm
|
|
|
|
|
Salam, Good morning everyBody
I want to insert a gridCtrl to my CDialog but I don't find the control in controls menu. can you help me ?
thanks
|
|
|
|
|
Use "Insert ActiveX control" and choose GridCtrl.
OR
Use Chris' Grid Control[^]
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
yes I use this I"nsert ActiveX control" but I only find
- Hirarchical FlexGrid Control
- SSOLEDBGridContrl
-DataGridCtrl (this one is for data from database I don't need it)
thank's for the example,I see it but it's very advanced I want some thing for begginers
|
|
|
|
|
Hi All,
I want to remove menubar from bitmap file then want to display it.
Thanks.
There Is Nothing Right & Wrong
|
|
|
|
|
A bitmap is just an image, so what does it have to do with a menubar ??
You have to explain a lot better if you want some decent answer.
|
|
|
|
|
Hi..All
I want to remove menubar from my bitmap,
How can i overcome this probleb???
Thanks
There Is Nothing Right & Wrong
|
|
|
|
|
Hi,
I need to convert a UTF8 string to its equavalant unicode number.
For ex. for character ứ its unicode no. is 7913.
Can anybody suggest How to do that.
Regs
Vinet
Vineet Kumar Singhal
Sr.Software Engineer
Mumbai
Tough Time Never last, but Tough People do.
|
|
|
|
|
What string class are you using?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
WideCharToMultiByte()
MultiByteToWideChar()
helps to convert 1byte -> 2byte and other way round data representation things
|
|
|
|
|
Hi all
I have not found a suitable place to ask this quesion . pls excuse me if wrong :
How to delete RAS entries manually in WinXP PC ?
redindian
|
|
|
|
|
dharani wrote: RAS entries
|
|
|
|
|
Mr Intelligent
Thanks for telling me about google ...
wow ...I enter R A S and it shows me 100s of web pages .
Which page should I see now ?
Pls tell me ..I have short sight and long sight and also special sight which does not see things after 6 PM ....
redindian
|
|
|
|
|
People are not that stupid like you to have posted a question without googling. I can also see couple of your careless responses where you keep directing people to google. If you know the answer share it with them else keep your mouth shut and let others answer .
redindian
|
|
|
|
|
this is my signature... i didn't answered to you to google (if you're not that smart to figure it by yourself)
i asked you to give more precision, because you question is totally naked
oh also, as you are that smart, couldn't you simply edit your message instead of posting 2 ones at 3 minutes each
|
|
|
|
|
If you do not know what I meant by "RAS entries" its better you do not ask for clarification . Coz if a person does not have sufficient knowledge about Remote Access Server there is no use telling him about it in order to get an answer .
I hope you get the point .
redindian
|
|
|
|