|
Doc Rivers blogging |
2004-04-28 |
| Among many others at NBA.com. It isn't as unvarnished as some, but I guess most companies don't have the league's PR problems (1) (2). | |
|
AOP going mainstream? |
2004-04-27 |
|
eWeek says that IBM is set to being using AOP technology in products within 12 to 15 months. My earlier comments still hold, but I believe that software development companies (as opposed to the other 99% of the programming world) are the best place for AOP, because of the high quality of their development staff. |
|
|
SF review |
2004-04-23 |
|
The best and worst of San Francisco, starting with the highlights:
And the lowlights:
|
|
|
Larry Ellison, kayak guy |
2004-04-15 |
| Am I the only person who did a double take on reading that San Francisco resident and computer company employee Larry Ellison retrieved Barry Bonds' 660th and 661st home runs in a kayak? | |
|
World tour! |
2004-04-13 |
|
I am a few days away from a world tour of the US and Australia. It goes London to San Francisco to Brisbane (via LA with some dead time in Auckland) to NYC (via LA again) and back to London. Sunday in SF is going to be cool – we are going to Alcatraz early in the morning, before taking our (cheap) seats at the Giants vs. Dodgers game. I am going to squeeze a week in at PLAS somewhere in there, as well as meeting up with Rinzen in New York. And I am leaving enough room in my luggage for at least one giant foam hand. |
|
|
Apocalypse Programming (apologies to Conrad and Coppola) |
2004-04-06 |
|
We've had the death march and cargo cult programming. I'd like to propose another addition to the programming lexicon: the Colonel Kurtz project. How do we spot Kurtz projects? Try the following:
|
|
|
RSS tweaks |
2004-04-05 |
| I have altered my RSS a little over the last couple of days to add a publication date. It created a few dups in RSS Bandit, but otherwise worked fine. | |
|
QueueUserWorkItem() vs. Start() |
2004-04-05 |
|
I caught a conversation yesterday along the lines of “work intiated by QueueUserWorkItem won’t complete if the main thread exits, but work initiated by Thread.Start will.” The .Net threading APIs are a pleasure to use, but there are a couple of little catches for the unwary. One of these is the difference between foreground and background threads. The behaviour described above is certainly the way it looks out of the box: pool threads (the threads used by QueueUserWorkItem) are background threads by default, whereas threads created by the programmer are foreground threads. The thing to note here is that threads can be switched from foreground to background mode. Consider the following example1, which creates a foreground thread via QueueUserWorkItem:
/*
1. Uses QueueUserWorkItem, waits for second thread to complete before unloading app domain
*/
class ThreadTest {
static void Main() {
System.Console.WriteLine("Main method 1");
System.Threading.WaitCallback callback = new
System.Threading.WaitCallback(Work);
System.Threading.ThreadPool.QueueUserWorkItem(callback);
System.Threading.Thread.Sleep(0);
System.Console.WriteLine("Main method 2");
}
static void Work(object state) {
System.Threading.Thread.CurrentThread.IsBackground = false;
System.Console.WriteLine("New thread work 1");
System.Threading.Thread.Sleep(10000);
System.Console.WriteLine("New thread work 2");
System.Threading.Thread.CurrentThread.IsBackground = true;
}
}
By manipulating the IsBackground property, I can also manually create a background thread, which will not stop the app domain from unloading:
/*
2. Uses Thread.Start, does not wait for second thread to complete before unloading app domain
*/
class ThreadstartTest {
static void Main() {
System.Threading.ThreadStart start = new System.Threading.ThreadStart(
ThreadstartTest.Work
);
System.Console.WriteLine("Main method 1");
System.Threading.Thread newThread = new System.Threading.Thread(start);
newThread.IsBackground = true;
newThread.Start();
System.Console.WriteLine("Main method 2");
}
private static void Work() {
System.Console.WriteLine("New thread work 1");
System.Threading.Thread.Sleep(10000);
System.Console.WriteLine("New thread work 2");
}
}
1This example produces the desired effect, but might not work all the time in the wild: the second thread becomes foreground once the Work method is called. If the first thread yielded, but the QueueUserWorkItem was not serviced, it might never run. |
|
|
Weekend reading |
2004-04-02 |
|
I am planning on hiding out for the weekend to get through some books:
No way am I dodging my literature review / research project. |
|