ok let me explain more, i want to know witch solution is better,
first of all i know i need 30 units, but i have priority for switch task, i need my main thread run with download thread somehow simultaneity but if sleep time of main thread finished the download thread must go to sleep and wait to up until main thread again finish, so in your explanation we cant send a signal to a thread to sleep and call another thread to run, we can do this right? and if you say yes, how much this process better than use timers (in timers mode probably main thread dont run until download thread finish)
we have a loop for main thread and we set a wait condition this is main loop
while(1) {
waitOn(); // check if Ui is in waiting state and if its not set uis and download to wait
doWork();
setOn() // set wait to free
sleep(100);
}
and our problem is download thread, its not run sync so i dont know how implement it?
and finally you dont say if i send my sample download command i a thread object and then call exec() function of that thread everything works in event loop of that thread right?
Bookmarks