+ 4

Why I getting an error?

I don't know why the test case fail, pls help https://code.sololearn.com/cZop5eeRXte7/?ref=app

14th Apr 2023, 6:46 PM
Sakshi [Offline ūüôÉ]
Sakshi [Offline ūüôÉ] - avatar
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 ūüēä
14th Apr 2023, 7:52 PM
Sakshi [Offline ūüôÉ]
Sakshi [Offline ūüôÉ] - avatar
+ 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.
14th Apr 2023, 6:54 PM
Ani Jona ūüēä
Ani Jona ūüēä - avatar
14th Apr 2023, 7:40 PM
Jayakrishna ūüáģūüá≥
+ 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..
14th Apr 2023, 8:02 PM
Jayakrishna ūüáģūüá≥
+ 5
Jayakrishna ūüáģūüá≥ Yaa! I need to reverse the order because it depends on the thread priority ūüėÖ
14th Apr 2023, 8:13 PM
Sakshi [Offline ūüôÉ]
Sakshi [Offline ūüôÉ] - avatar
+ 2
You're welcome :)
15th Apr 2023, 4:20 AM
Ani Jona ūüēä
Ani Jona ūüēä - avatar