jump to navigation

kernel synchronization study note (1) June 20, 2007

Posted by TSAI HONG-BIN in Linux.
add a comment

To understand how linux kernel synchronizes is a huge task… and I finally found out how bad my OS concepts is at reading.

Three main structures that closely relate to kernel synchronization and scheduling: softirq, tasklet and work queue.

Before digging into each structure, we must know that the term “context” is used to describe some binary code runs in CPU. So if you may recall, “context switching” refers to the switch of processes run in CPU. A context runs as a process is called process context, in addition to regular processes, a CPU needs to deal with interrupts (either Hardware or Software). Thus the context runs as an interrupt handler is called interrupt context.

The main difference between process context and interrupt context is that process context can block, while interrupt context can’t.

“deferrable functions” are non-urgent interruptible kernel functions (i.e. softirq and tasklet) that run in interrupt context. Work queue, however, runs in process context.

tasklets are implemented on top of softirqs. the structure of tasklet is defined in ~/linux-src/include/linux/interrupt.h. Besides, the enumeration of softirq signals are defined several lines before tasklet_struct. As the comment says, “For almost all the purposes tasklets are more than enough.” If one needs to write a device driver, tasklets should be sufficient.

Work queue, however, is for creating a process that sleeps if necessary. For example, waits for user data.


Connie on Britain’s got talent June 15, 2007

Posted by TSAI HONG-BIN in Music.
add a comment

Another incredible singer. This cute girl.. she is really cute especially without incisors. [Over the rainbow] is a lullaby, and she did sing it tranquilly. Though the breathing is wrong (should not take breathe in the middle of a word) and she cannot control her breathing well so the high tune shakes and diminishes, her voice indeed moved the audience. And, it’s totally understandable why Amanda weeps, because, I feel the same way. Haha, after experiencing the chaos around us, she did sound like an angel that comforts people. =)

Paul Potts on Britain’s got talent June 15, 2007

Posted by TSAI HONG-BIN in Music.
1 comment so far

If he never goes to vocal classes, then he must be born opera singer. Nessun Dorma is a huge piece for all Tenors, I can hardly believe that he just sang it so naturally like he’s not putting much effort to “work on” the sound. Even a professional tenor needs to take years of practice to make it.

However, frankly speaking, his singing is good for that he’s no pros. His sustainment is shaky, and the space for is not vertical enough. But what I really appreciate is the sentiments in his voices. Though people sing Puccini’s work sentimentally all the time, but it’s pretty difficult to take care the “shaping your voice” and “shaping your emotions” at the same time. I mean, this guy must got moved by this song, and so it moves me. =)

missing pages June 14, 2007

Posted by TSAI HONG-BIN in Diary.
1 comment so far

OH MY GOD!! @.@

My “Advanced Programming in the UNIX Environment” got missing pages. It’s totally blank on page 273-276, 289-292 and 297-300 .. the number is still growing.

I should not buy it before reading through > <

And the bookseller said they don’t have spare books since 2005 … I’m a bad student …

Got pppoe working June 5, 2007

Posted by TSAI HONG-BIN in Linux.
add a comment

On Ubuntu! so exciting.

It takes about … almost an hour, and I can hardly tell how it works … it’s working anyway. No wonder normal people feel like to stick to Micro$oft windows, at least it takes less than 5 minutes to get online over PPPOE. Oh! did I mention that my alpha blending effect works on merely 256MB RAM? I can afford the time to set up my system, but not the money. Question, will you spend over $3000 on additional RAM just for “watching windows fading?” How about you save the money and see a 3D cubic desktop swirling?

Anyway, do

#sudo apt-get install pppoe

in advance. Than run

#sudo pppoe-setup

follow the instructions to give your username and password that issued by your ISP. Edit /etc/ppp/peer/dsl-provider and give

user username@sample.net

now run

#sudo pon dsl-provider

and get ready to spin