Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

thread starting

Featured Replies

Posted

i created a thread using CreateThread succesfully. the problem is that the thread is not directly after creating is executed.


the thread will be executed after calling Sleep().


the thread is not created in suspended mode, but with the creation flag 0 (0 = The thread runs immediately after creation.).


 


but still the thread is not executed direclty.


 


any suggestions?



 invoke CreateThread, 0, 0, addr ThreadProc, NULL, 0, addr dwThreadID
 
invoke Sleep, 200 ; when reaching this code the thread created above should be executed first

Edited by Readme

Alternatively you can use a Boolean global variable and check on a loop from your main thread if its true then execute your code. You set this value to true from your newly created thread. Just a suggestion though.


You can try the flag THREAD_PRIORITY_HIGHEST


  • Author

seems to work deepzero and aguila. thanks people 


 


and lostin, thanks for the suggestion


The whole point of the thread scheduler is that *the scheduler* gets to decide when the thread will execute. Given enough critical-priority threads elsewhere in the system, you can end up with your thread essentially never running at all.

The whole point of the thread scheduler is that *the scheduler* gets to decide when the thread will execute. Given enough critical-priority threads elsewhere in the system, you can end up with your thread essentially never running at all.

 

is that helpful for the system or can it be exploited? creating a thread and it never running, doesnt a thread die with the program that creates it?

Edited by JMC31337

is that helpful for the system or can it be exploited? creating a thread and it never running, doesnt a thread die with the program that creates it?

 

Depending on how the application is exited, it is not guaranteed to hault the threads which will leave the application in a 'hung' state while the threads continue to run.

As Microsoft explains:

 

The thread object remains in the system until the thread has terminated and all handles to it have been closed through a call to CloseHandle.

Thread TSR (under a hung app state)

Interesting...

Guess that goes for all OS' vista win7 and sp3?

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.