Hacker News new | past | comments | ask | show | jobs | submit login

I feel like you are mixing up threads and cores.

In win95 there is preemption. The kernel can swap out threads on a timer interrupt to create the illusion despite no actual multiprocessing. You don't need real multicore to have that. But the programming model is the same as if you had it.

Elsewhere on this thread (uhh the other kind) it sounds like the threads here are not preemptible. So cooperative multitasking.




Did you mean to respond to me? In a sibling to my original comment it looks like theclaw cites a page that implies the scheduler handles the "yield process" and does preempt running threads. Windows 3.1 used cooperative multitasking which is why a single program could "lock up" the whole system.


The programming model is not quite the same. You can get away with some things if you know only one thread is running at a time. You have to mutex a lot less for one.


I disagree. You don't know where in your code the scheduler will interrupt you, it could be any time, so if you do unsafe things to shared structures you still need the mutex, it's just less likely that you will get rescheduled at precisely the right moment to hit it.

In other words data races will still potentially cause another thread to see a data structure in an intermediate state. It will just be a rare bug instead of a potentially more common one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: