Click here to Skip to main content
15,173,939 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
obermd1-Mar-21 4:16
Memberobermd1-Mar-21 4:16 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
milo-xml1-Mar-21 5:41
professionalmilo-xml1-Mar-21 5:41 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
honey the codewitch1-Mar-21 5:46
mvahoney the codewitch1-Mar-21 5:46 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
milo-xml2-Mar-21 4:33
professionalmilo-xml2-Mar-21 4:33 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
Stuart Dootson2-Mar-21 8:14
professionalStuart Dootson2-Mar-21 8:14 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
honey the codewitch2-Mar-21 8:22
mvahoney the codewitch2-Mar-21 8:22 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
Stuart Dootson2-Mar-21 9:00
professionalStuart Dootson2-Mar-21 9:00 
GeneralRe: And when you depend on multithreading to be unpredictable, it isn't! Pin
honey the codewitch2-Mar-21 9:48
mvahoney the codewitch2-Mar-21 9:48 
In the case where thread A and thread B operate at the same priority, everything works until we start looking at who to unblock. It will always unblock the next thread in the round robin list. if thread A is coded where it sleeps twice for every time thread B sleeps once, I think it will lead to one of them being starved. I'm not entirely confident in that without testing it, but it's easy for me to starve a thread in the wild on this OS.

If it were me i would have stored the machine tick based timestamp on the last time the thread was unsuspended. all priorities considered equal, i would use that to determine which to wake up next, and then if further disambiguation was necessary (doubtful) it could round robin, but i don't think that's even necessary.
Real programmers use butterflies


modified 2-Mar-21 14:56pm.

GeneralInteresting demographic? Pin
#realJSOP27-Feb-21 12:38
mva#realJSOP27-Feb-21 12:38 
GeneralRe: Interesting demographic? Pin
Eddy Vluggen27-Feb-21 12:43
professionalEddy Vluggen27-Feb-21 12:43 
GeneralRe: Interesting demographic? Pin
#realJSOP27-Feb-21 12:57
mva#realJSOP27-Feb-21 12:57 
GeneralRe: Interesting demographic? Pin
Gary R. Wheeler27-Feb-21 13:32
MemberGary R. Wheeler27-Feb-21 13:32 
JokeRe: Interesting demographic? Pin
raddevus28-Feb-21 13:38
mvaraddevus28-Feb-21 13:38 
GeneralRe: Interesting demographic? Pin
OriginalGriff27-Feb-21 12:54
mveOriginalGriff27-Feb-21 12:54 
GeneralRe: Interesting demographic? Pin
markrlondon27-Feb-21 13:32
Membermarkrlondon27-Feb-21 13:32 
GeneralRe: Interesting demographic? Pin
Marc Clifton27-Feb-21 12:59
mvaMarc Clifton27-Feb-21 12:59 
GeneralRe: Interesting demographic? Pin
User 1505013427-Feb-21 13:25
MemberUser 1505013427-Feb-21 13:25 
GeneralRe: Interesting demographic? Pin
markrlondon27-Feb-21 13:30
Membermarkrlondon27-Feb-21 13:30 
GeneralRe: Interesting demographic? Pin
Dave Kreskowiak27-Feb-21 13:50
mveDave Kreskowiak27-Feb-21 13:50 
GeneralRe: Interesting demographic? Pin
User 1505014627-Feb-21 14:09
MemberUser 1505014627-Feb-21 14:09 
GeneralRe: Interesting demographic? Pin
#realJSOP27-Feb-21 14:38
mva#realJSOP27-Feb-21 14:38 
GeneralRe: Interesting demographic? Pin
Dave Kreskowiak27-Feb-21 15:06
mveDave Kreskowiak27-Feb-21 15:06 
GeneralRe: Interesting demographic? Pin
Marc Clifton27-Feb-21 14:13
mvaMarc Clifton27-Feb-21 14:13 
GeneralRe: Interesting demographic? Pin
Sander Rossel28-Feb-21 0:27
professionalSander Rossel28-Feb-21 0:27 
GeneralRe: Interesting demographic? Pin
Nelek27-Feb-21 13:03
protectorNelek27-Feb-21 13:03 

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.