Wikipedia's green thread article states that most Smalltalk dialects implement green threads. Why is the term most used for the assertion? Don't all Smalltalk dialects implement green threads?
Sunday, March 28, 2010
Consider a loop that sums the first p - 1 odd integers modulo p (thus enumerating the quadratic residues modulo p). For each odd integer, an internal counter is incremented, and then the modulo p operation is applied. For example, for p = 19, the first five internal counter values will be 1, 4, 9, and 16. The next value will be 25, which will be mapped into 6 when seen modulo 19 (hence 6 is a quadratic residue modulo 19).
What is the maximum value the internal counter can reach before the modulo operation?
Posted by Andrés at 22:07
Sometimes the most humble of problems turns out to be a rich field for exploration. How about this one? Find the fastest way to implement atAllPut:, for large array receivers. Surely this cannot be that hard, right? But no, it really is tricky.
Curious? Don't take my word for it: run the experiments and see what happens!
Posted by Andrés at 15:22
Sunday, March 21, 2010
I just finished section 6.2 of Fundamentals' second volume. The draft page count is 82. Next up, section 6.3 on thread safety.
You know, when I began writing this chapter, I was concerned I wouldn't have enough material to write something interesting. I wasn't really excited about it, and I just wanted to get through it as quickly as possible so I'd get to chapter 7 (which is about recursion). And yet, here I am, having a lot of fun, not even half done with chapter 6, and it's 50 pages long already.
If this pattern continues, I may have to split off chapter 9 (about optimization) into a third volume...
Posted by Andrés at 20:49
Friday, March 19, 2010
Friday, March 05, 2010
Wednesday, March 03, 2010
This version fixes a subtle problem. Assessments would stop SUnit resources before starting them for bulletproofing purposes. However, I just found a resource written to stop only after tests run, because the #reset method does not worry about whether instances of the resource exist. This causes a problem because the reset action damages other resources that are necessary for tests to run. Consequently, do not stop resources before starting them.
Posted by Andrés at 18:27
Every so often, I find articles along the lines of "fMRI proves that area of the brain X is involved in activity Y". But, is that the case? How do we know that area X is processing activity Y directly? Couldn't it be the case that area X is processing something else triggered by activity Y, while merely 3 neurons process activity Y? We are not aware of all our brain is doing, how can we claim there is nothing else going on other than activity Y?
The main issue here is that all we see is activity. We do not know what the activity represents because we do not know how the brain encodes what is going on. Essentially, what we can perceive is ciphered conversations between neurons. From the traffic, we would like to infer the meaning of the traffic. But we can't do that with full confidence without breaking the code.
I actually verified this point of view with a neuroscience expert. And yes indeed, all we really have is correlations illustrated by nice fMRI graphics. Maybe not all experts think the same. And yet, although correlation is better than guessing, it's most likely still far away from proving (and supporting the hyped) causality.
Posted by Andrés at 09:18