March 29, 2004

Oh, someone is working on that?

For our term project in computer science, we have to write an operating system simulator. We are going to have to use pthreads to "execute" multiple programs which opens up a whole host of issues, the first of which is that we have no real idea how to use pthreads.

I'm trying to remedy that. One of the things we need to do is put the pthreads to sleep in queues, where they wait their turn to execute. You'd think there would be a simple way to do this because this sleep/wake sort of scheduling operation is very useful. You'd think.

Googling on "pthread sleep wake" brought up some instructive sites which seem to indicate otherwise, but I can't be sure because they're written to somewhere above my level. A few of the web pages are archived emails from developer mailing lists. One of the emails, I'm tickled to see, is from Linus Torvalds himself. Cool. Maybe this whole pthread thing will get less kludgy. Then I check the date of the email. 1996. Maybe not.

Meanwhile, it slowly occurs to me that we might be able to avoid the whole issue by using semaphores to handle the queuing and scheduling.

202 words | March 29, 2004 09:06 PM | Ivory tower