I Am Such A Bad Programmer

It’s hard to believe that someone hasn’t come to my house and taken away my compilers yet. I’m serious.

Remember how I said that LevelEd was broken under Snow Leopard and I wasn’t sure how to fix it? Right, well, it turns out that the problem is that I had the renderer running on a thread but there were multiple threads making calls into OpenGL. This causes major problems, including Kernel Panics (hard lock on a Mac).

So once it dawned on me that the threading was probably at fault, I put in an NSLock to control access to the OpenGL drawing routines and now the editor works again.

What I don’t understand is – How did it ever work on Leopard? Why does Snow Leopard expose this problem where Leopard didn’t? It’s either software gremlins or maybe Leopard had a much more relaxed approach to threading or something.

At any rate, work can now continue on the endless project known as the ToeTag Editing Suite.

2 Responses to “I Am Such A Bad Programmer”

  1. SleepwalkR says:

    Threading has been completely overhauled in 10.6, so I’m guessing that’s why it’s more strict now.

    See http://en.wikipedia.org/wiki/Grand_Central_Dispatch

  2. Warren says:

    Admittedly, the way I was doing things was horrible so it SHOULD have been failing all this time. I guess Snow Leopard decided to rub my face in it. :P

Leave a Reply