4 ms·
> By effectively doing your own timeslicing, you remove the need for any locking or concurrency issues Native threads do this timeslicing for you; that is why
by ErrantX 17y ago
> By effectively doing your own timeslicing, you remove the need for any locking or concurrency issues
Native threads do this timeslicing for you; that is why they were invented (so that programmers didnt have to mess around with crazy micro-management of that they were doing).
Can you imagine writing Chrome or FireFox using a single thread (it would be hard, and probably unusable)? :)
Threads serve an excellent purpose
- krakensden 17y ago> Can you imagine writing Chrome or FireFox using a single thread (it would be hard, and probably unusable)? :) Firefox is single threaded. Chrome runs each tab in its own process- also not multithreading.
- petewarden 17y ago> Firefox is single threaded Incorrect. See http://mxr.mozilla.org/firefox/search?string=thread http://mxr.mozilla.org/firefox/search?string=thread
- andrew1 17y agoAt least on Windows they are both multi-threaded. If you look in Task Manager then firefox.exe will have multiple threads (32 on my machine) and each chrome.exe process will have multiple threads (anywhere between 3 and 21 on the 15 tabs I have open).
- coliveira 17y ago> Native threads do this timeslicing for you; that is why they were invented But they don't solve the fundamental problem of how to organize your code to take advantage of this. It is really easy to create a threaded application that has lower performance than a single threaded application that divides work by chunks. And, after all research in this area, there is no clear way to use threads without spending a lot of time to make sure that they work.
- axod 17y agoAgree 100%. Often using threads are a false economy.