Click here to Skip to main content
15,042,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: connection between two machines in network Pin
GauranG Shah20-Sep-07 1:49
MemberGauranG Shah20-Sep-07 1:49 
AnswerRe: connection between two machines in network Pin
Hamid_RT20-Sep-07 4:19
MemberHamid_RT20-Sep-07 4:19 
Questiondirectx in mfc Pin
saisp20-Sep-07 1:31
Membersaisp20-Sep-07 1:31 
Questionwant to add any number of images of any type in a dialog box using mfc only Pin
Dhiraj kumar Saini20-Sep-07 1:14
MemberDhiraj kumar Saini20-Sep-07 1:14 
AnswerRe: want to add any number of images of any type in a dialog box using mfc only Pin
jhwurmbach20-Sep-07 2:43
Memberjhwurmbach20-Sep-07 2:43 
GeneralRe: want to add any number of images of any type in a dialog box using mfc only Pin
Dhiraj kumar Saini20-Sep-07 3:30
MemberDhiraj kumar Saini20-Sep-07 3:30 
GeneralRe: want to add any number of images of any type in a dialog box using mfc only Pin
jhwurmbach20-Sep-07 3:51
Memberjhwurmbach20-Sep-07 3:51 
QuestionProblem between CPU Utilization & Data Transfer Pin
Andy Rama20-Sep-07 1:09
MemberAndy Rama20-Sep-07 1:09 
Hi to all,

I have written a code in C++ using VC6 compiler to transfer data at 'm_Bitrate' bps as follows,

if( cycle1[m_PID] != -1 )
{
	do
	{
		Sleep(1);
		Int64 cycles;

		_asm rdtsc;
		_asm lea ebx,cycles;
		_asm mov [ebx],eax;
		_asm mov [ebx+4],edx;

		cycle2[m_PID] = cycles;
	}while( (cycle2[m_PID]-cycle1[m_PID]) < (MachineCycPerSec*188*8*total_packs/m_Bitrate));
}
//Code to tranfer data ...

	Int64 cycles;

	_asm rdtsc;
	_asm lea ebx,cycles;
	_asm mov [ebx],eax;
	_asm mov [ebx+4],edx;

	cycle1[m_PID] = cycles;


But if I remove Sleep(1); statement, then I got approximate data transfer bitrate, but it takes maximum CPU utilization;
& if I add Sleep(1); statement, then CPU utilization is les, but transfer bitrate is very less than 'm_Bitrate' bps.

Is their any optimum solution here? OR
Is their any wrong logic used for data tranfer? OR
Any way to reduce CPU utilization (Sleep for less than 1 Millisecond)?

Please help.
Thanks in advance.

Thanks & Best Regards,
Aniket A. Salunkhe
AnswerRe: Problem between CPU Utilization & Data Transfer Pin
Cedric Moonen20-Sep-07 1:19
MemberCedric Moonen20-Sep-07 1:19 
QuestionRe: Problem between CPU Utilization & Data Transfer Pin
Andy Rama20-Sep-07 1:31
MemberAndy Rama20-Sep-07 1:31 
QuestionHow to code Pin
snoop8220-Sep-07 0:06
Membersnoop8220-Sep-07 0:06 
AnswerRe: How to code Pin
Nelek20-Sep-07 0:34
protectorNelek20-Sep-07 0:34 
GeneralRe: How to code Pin
snoop8220-Sep-07 0:40
Membersnoop8220-Sep-07 0:40 
GeneralRe: How to code Pin
Nelek20-Sep-07 1:47
protectorNelek20-Sep-07 1:47 
GeneralRe: How to code Pin
snoop8220-Sep-07 2:15
Membersnoop8220-Sep-07 2:15 
GeneralRe: How to code Pin
Nelek20-Sep-07 3:05
protectorNelek20-Sep-07 3:05 
GeneralRe: How to code Pin
David Crow20-Sep-07 17:42
MemberDavid Crow20-Sep-07 17:42 
QuestionRe: How to code Pin
David Crow20-Sep-07 17:44
MemberDavid Crow20-Sep-07 17:44 
AnswerRe: How to code Pin
DevMentor.org20-Sep-07 18:20
MemberDevMentor.org20-Sep-07 18:20 
QuestionHow to use bitmap buttons Pin
Engr_Arsalan19-Sep-07 23:28
MemberEngr_Arsalan19-Sep-07 23:28 
AnswerRe: How to use bitmap buttons Pin
KarstenK19-Sep-07 23:54
mveKarstenK19-Sep-07 23:54 
GeneralRe: How to use bitmap buttons Pin
josip cagalj20-Sep-07 3:19
Memberjosip cagalj20-Sep-07 3:19 
GeneralRe: How to use bitmap buttons Pin
KarstenK20-Sep-07 3:27
mveKarstenK20-Sep-07 3:27 
GeneralRe: How to use bitmap buttons Pin
josip cagalj20-Sep-07 3:32
Memberjosip cagalj20-Sep-07 3:32 
GeneralRe: How to use bitmap buttons Pin
Engr_Arsalan24-Sep-07 20:42
MemberEngr_Arsalan24-Sep-07 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.