Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


More Cpu time?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Sun Feb 13, 2011 8:16 pm    Post subject: More Cpu time? Reply with quote

Which takes more cpu time?
1) Switching between two processes.
2) Switching a process from user mode to kernel mode.
Considering the fact that switching between two process is done by cpu..
Back to top
View user's profile Send private message Send e-mail
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Sun Feb 20, 2011 7:28 am    Post subject: Reply with quote

Your question is a little vague. Are we just talking about a context switch triggered by the thread manager? If so, switching between user and kernel space probably takes a couple extra cycles - but nothing noticeable even if we were to switch a few thousand times a second. The extra cycles account for switching the processor's active ring number (i.e. ring3 -> ring0 in this case) and performing whatever checks the OS likes to do.

If you're talking about manual invokation of code through direct call or an event, it depends on a lot of factors:

  • How are you switching? A mutex is slower than two WaitForSingleObject wakeups on a global event.
  • Are you performing direct calls? CreateRemoteThread should be a little faster than DeviceIoControl or a syscall.
  • If I remember correctly, sometimes higher priority IO will cause a user->kernel dispatch to be delayed, or even allocated to be sent by DPC at a later time.


Give some more details and we can probably help more.

_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites