+ 4
Why I getting an error?
I don't know why the test case fail, pls help https://code.sololearn.com/cZop5eeRXte7/?ref=app
6 Réponses
+ 6
Ani Jona 🕊 yes you are right my mistake is I write this:-
name.start();
welcome.start();
instead of this:-
welcome.start();
name.start();
Thank you both of you Jayakrishna 🇮🇳 Ani Jona 🕊
+ 5
Thread priorities are but a suggestion. Also, the thread runtime is very short so priorities may not take effect. But still output needs to be in proper order to be accepted. Try reversing the order in which you start the threads and see if that changes anything. If it doesn't succeed in the first try, hit run again. At some point the order of output will be correct.
+ 5
Priorities not in effect.
( try by Hack it by using sleep method.)
More info.
https://www.sololearn.com/discuss/2606071/?ref=app
https://www.sololearn.com/discuss/2211828/?ref=app
https://www.sololearn.com/discuss/2454066/?ref=app
+ 5
It's not a mistake. Task is too do like that only. Just it won't work as expected because of code which just need too less time. Reverse is also a hack to pass test. ( if it is thread priority task which i know).. You're welcome..
+ 5
Jayakrishna 🇮🇳 Yaa! I need to reverse the order because it depends on the thread priority 😅
+ 2
You're welcome :)