Feeds:
Posts
Comments

Archive for the ‘Uncategorized’ Category

This entry was brewing since an asynchronous programming bout I had a couple of months ago that left me pretty scarred. I finally found time to finish it. Hope you enjoy it!

Let's see if you can guess the epic reference 🙂

What is asynchronous programming?

Asynchronous programming is yielding your thread while waiting for an external processing. This is usually useful for I/O, be that network, disk, or reading from a DB. In essence, instead of doing:

Foo() {
 // do some computation
 barResult = myAwesomeButSlowInputOutput.Bar(some params);
 // do some more computation
}

You want to do:

Foo() {
 // do some computation
 myAwesomeButSlowInputOutput.AsyncBar(some params, &FooCallback,
     all the params FooCallback needs from current context);
}
FooCallback(bajillion params) {
  // do some more computation
}

(more…)

Advertisements

Read Full Post »

Of Oxen and Lions

This is a story I read in a few different sources in Turkish, it’s called “Sari Okuz”, which means “The Yellow Ox”. I don’t quite know where it originates, maybe a La Fontaine story, though I couldn’t find it.

***

Once upon a time, in a forest far away, all the lions of the forest assembled in a meeting.

The situation was dire, as the food was awfully scarce. “When we attack the monkeys, they run to the trees” they thought. “The elephants are too large, the gazelles too fast, the birds fly, and surely we’re not going to go after the fishes?”. The lions didn’t know what to do.
(more…)

Read Full Post »