A notch above a monkey

Dreaming about GIL

I’ve been thinking about Python’s global interpreter lock (GIL) again. Since I’m a glutton for punishment and haven’t been crucified in a week, you get to hear about it too.

Has anybody thought and wrote about avoiding GIL until you need it? What I mean is creating and using GIL only when you start using code that might not be thread-safe.

So, what’s wrong with this idea?

Things that come to my mind:

  • garbage collector is not thread-safe
  • majority of interesting modules are not thread-safe, so there would be little ROI
  • dynamic nature of Python means you can’t know in advance if you’ll need GIL and it would a bitch to fall back when you do
  • …

I guess it’s just a really stupid idea.

Mikroformati

Spletne urice se bodo ta teden nadaljevala s predavanjem o mikroformatih, ki ga bo imel fry v sredo, ob 19.00 v Kiberpipi. Na predavanje ste vsi vljudno vabljeni.

Javascript slider

I think HTML forms are probably the least well designed part of X/HTML specifications and at least some people agree. They were fine when they came out, but time has moved on and form elements just didn’t follow. There are too many things wrong with them, but personally I mostly miss a good control for date handling and a slider.

So here’s my take on a slider, implemented with javascript. You can also download this example packed in a zip .

It works at least in all major browsers, but I don’t consider it finished. However, since I haven’t found the time to finish it and I don’t think I will any time soon, I’ve decided to publish it anyway. It may be useful to somebody.

It’s fairly easy to use, if you can live with its limitations. You can create a horizontal or vertical slider. I believe example is self-explanatory, but if you find it difficult to use, please let me know and I’ll help.

Couple of things to remember. Code expects to find an image of button in subdirectory img and it shouldn’t be bigger than this one. If you need a different size, just correct javascript.

Also addEvent and delEvent functions in slider.js should be replaced with something more robust, when ppk’s team declares a winner.