pigfoot’s weblog

We should forget about small efficiencies — Donald Knuth

Archive for August, 2006

Announcing End of Life times (Fedora Core 1, 2, Red Hat Linux 7.3, 9)

Fedora Legacy Project announces End of Life Times of Fedora Core 1 & 2, Red Hat Linux 7.3 & 9 as Fedora Core 6 Test 2 releases at July 26th.

By the way, Red Hat is prepping Enterprise Linux 5 Desktop.

Popularity: 28% [?]

  • 0 Comments
  • Filed under: IT, Linux, RedHat, Unix
  • Real to plug Windows media support into Linux, from News.com.

    Currently, Linux users can play Windows Media Video (WMV) and Windows Media Audio (WMA) content if they install RealNetworks’s closed-source modules which Novell will include in its Suse Linux Enterprise Desktop 10 in the fourth quarter. Furthermore, RealNetworks will release open-source code to play the files as part of the Helix Community project as well.

    It’s special that it will change as the result of settlement of an antitrust suit against the software giant Microsoft.

    RealNetworks also is evaluating adding support for the AAC, an audio compression format used by Apple Computer’s iTunes and others.

    Popularity: 20% [?]

  • 0 Comments
  • Filed under: IT, Media, Unix
  • [FX/TB] Win32 Branch build

    Mozilla Firefox 2.0b1 Branch builds (20060815)

    Get Firefox!

    Sepecial Check-in

    Known Issues

    • N/A
    1. checkout finish: Tue Aug 15 04:25:09 PDT (UTC -0700) 2006
    2. All Chech-in, FX Chech-in from last build
    3. my vs7.1-BonEcho patch
    4. my tweaks profile patch
    5. Adobe Flash Player (9.0.16.0)
    6. Used branding artwork by JairoB
    7. UAO of zh_TW.Big5 Unicode Fix
    8. P0/P1/P2/P3 all build with VC7.1
    9. P0 build build with /GAL7 arch:SSE and mmoy’s SSE patches, for Athlon XP, and Duron 1.1 GHz+
    10. P1 build build with /GAL6 and mmoy’s MMX patches, for Generic CPU
    11. P2 build build with /GAL6 arch:SSE and mmoy’s SSE patches, for Pentium III ,Celeron 500+
    12. P3 build build with /GAL7 arch:SSE2 and mmoy’s SSE2 patches, for AMD Athlon 64, AMD Sempron, Pentium 4, Pentium M, and Celeron 1.7 GHz+

    Popularity: 8% [?]

  • 0 Comments
  • Filed under: Gecko, IT
  • 開發自己的 Xbox Game 非夢事, from engadget.

    原則上, XNA 是以 C# 作為程式開發語言. 不過不懂 C# 的玩家們也別難過, 因為 XNA 除了那些低階的函式外, 還提供數個”新手套件”. 根據原廠的說法, 一般使用者只要將這些 “新手套件” 組裝起來, 便能夠輕鬆開發出簡單的遊戲.

    喂喂喂~ 這樣不就是北打 OpenGL, 南踢 PS3 了嗎?

    不過, 我記得 DirectX 9.0b 的 DirectShow, 還沒有 managed code 的版本, 那時候在寫 C#, 還要用 System.Runtime.InteropServices 來和 DirectShow 溝通 (殘念, 這應該也是 DirectX family 唯一的一個沒有 managed code 的 component), 還是 Gamer developer 都不用 DirectShow 的啊? :p

    Popularity: 18% [?]

  • 0 Comments
  • Filed under: IT, Microsoft
  • Van Jacobson’s network channels

    Van Jacobson’s network channels, from LWN.net.

    Van Jacobson 在今年一月底的 linux.conf.au 上展示了他的 network channels 的 idea, 然後引發了一系列的討論. 雖然有不少障礙要克服, 不過設計上應該有蠻多學習的地方 ;-)

    Van 的 slides [PDF] 上講到, 傳統的 Networking stack, 到現在的實作已經變成了 “Standard Model”. 在 Linux kernel 實作上大概如下 (From Van’s slides):

    net channel 1

    當封包被網路卡收到, kernel 會收到 interrupt, 然後呼叫 ISR, 或是有註冊 NET_RX_SOFTIRQ 的 softirq handler (一般應該是 driver; 另, 這裡也可能是 tasklet), 會根據自己的硬體運作方法把 packer 收下來組成 skb, 然後呼叫 net/core/dev.c:netif_receive_skb(). netif_receive_skb() 這裡會檢查 payload 然後解多工. 舉個例子, IP 應該會送到 net/ipv4/ip_input.c:ip_recv() 去. 當然, 後面的 Socket (更高的像是 UDP/TCP Layer) 也是會參考這個 skb, 當然就大家所知, TCP 甚至還要組成 Byte-Stream.

    這樣的設計當可能有一些缺點, 為了不失原意, 我摘錄原文如下:

    • Passing network packets through multiple layers of the kernel.
      When a packet arrives, the network card’s interrupt handler begins the task of feeding the packet to the kernel. The remainder of the work may well be performed at software interrupt level within the driver (in a tasklet, perhaps). The core network processing happens in another software interrupt. Copying the data (an expensive operation in itself) to the application happens in kernel context. Finally the application itself does something interesting with the data. The context changes are expensive, and if any of these changes causes the work to move from one CPU to another, a big cache penalty results. Much work has been done to improve CPU locality in the networking subsystem, but much remains to be done.
    • Locking is expensive.
      Taking a lock requires a cross-system atomic operation and moves a cache line between processors. Locking costs have led to the development of lock-free techniques like seqlocks and read-copy-update (RCU), but the the networking stack (like the rest of the kernel) remains full of locks.
    • The networking code makes extensive use of queues implemented with doubly-linked lists.
      These lists have poor cache behavior since they require each user to make changes (and thus move cache lines) in multiple places.

    因此, 為了要增加 networking scalability, 首要就是要消除 locking 和 shared data. Van 利用 end-to-end principle 來達成這個目的. 也就是說, 盡可能的讓資料交給 application, 而不要在 kernel 任何地方等待. 於是他設計了 net channel — 一個 circular buffer (應該是 Circular FIFO queue implemented by Array) 用來取代 skb 和目前用在 networking stack 的 queue. 比方說, 原先需要用 softirq 的地方 (driver -> socket), 改用 netchannel, locking 數都明顯的下降, 進而提高 scalability.

    但是, 這個方法遇到的第一個問題就是, 讓資料從 packet 一條鞭的到 application, 會把 netfilter 的原先 hook 的點變相的消除, 為了加回來 netfilter 的 support, 利用得到的優勢便蕩然無存了.

    不過我有一點不懂的是, 一個還算簡單的 circular buffer, 為何是 “Cache aware, cache friendly queue” 呢? 是因為用 Array implement 這樣嗎? :p

    Popularity: 21% [?]

  • 0 Comments
  • Filed under: Develop, Kernel
  • Untwisting Python Network Programming, from O’ReillyNet.

    This article introduces basic client-side networking using both core Python modules and the Twisted framework. For its example, I will show how to send, receive, and delete emails, and conduct Telnet sessions.

    I have written two functionally equivalent examples, one using the core modules (mail-core.py) and another using Twisted (mail-twisted.py), with both start, stop, and interact with a server to process emails.

    Here is outline:

    core Python modules

    • Sending Mails with smtplib
    • Retrieving Emails with poplib
    • Conducting Telnet with telnetlib

    Twisted Way

    • Sending Mails the Twisted Way
    • Retrieving Mails with Twisted
    • Doing Telnet with Twisted

    When to Be Twisted?

    The two functionally equivalent programs, one using Python core modules and the other using the Twisted framework, significantly differ from each other in terms of programming style and the amount of code. Then when should you use either of the two options?

    For basic programs such as the command-line client of this example, the Python core networking modules are more desirable due to the simplicity and performance advantages. However, most real-world networking programs are very complex, and Twisted’s asynchronous programming model is more effective.

    For example, BitTorrent, the popular peer-to-peer file sharing client that performs massive parallel downloading of data chunks from different sources, uses Twisted. Twisted also works well in programs with graphical user interface (GUI), because its asynchronous nature fits more seamlessly with the event-driven programming models of modern GUI frameworks. In fact, Twisted has integration with popular GUI frameworks including PyGTK, Qt, Tkinter, WxPython, and Win32.

    The other area where Twisted shines is in server programming. A typical network server uses multithreading so that it can handle multiple clients concurrently. The asynchronous mechanism of Twisted alleviates the creation and handling of threads by server programs. In addition, Twisted provides several protocols on which to build new networking services, enabling rapid development of complex servers. One such project is Quotient, which adopts Twisted to build a multiprotocol messaging server that supports a variety of protocols and services including SMTP, POP3, IMAP, webmail, and SIP.

    Popularity: 17% [?]

  • 0 Comments
  • Filed under: Develop, Python
  • [FX/TB] Win32 Branch build

    Mozilla Firefox 2.0b1 Branch builds (20060813)

    Sepecial Check-in

    Known Issues

    • N/A
    1. checkout finish: Sun Aug 13 03:05:08 PDT (UTC -0700) 2006
    2. All Chech-in, FX Chech-in from last build
    3. my vs7.1-BonEcho patch
    4. my tweaks profile patch
    5. Adobe Flash Player (9.0.16.0)
    6. Used branding artwork by JairoB
    7. UAO of zh_TW.Big5 Unicode Fix
    8. P0/P1/P2/P3 all build with VC7.1
    9. P0 build build with /GAL7 arch:SSE and mmoy’s SSE patches, for Athlon XP, and Duron 1.1 GHz+
    10. P1 build build with /GAL6 and mmoy’s MMX patches, for Generic CPU
    11. P2 build build with /GAL6 arch:SSE and mmoy’s SSE patches, for Pentium III ,Celeron 500+
    12. P3 build build with /GAL7 arch:SSE2 and mmoy’s SSE2 patches, for AMD Athlon 64, AMD Sempron, Pentium 4, Pentium M, and Celeron 1.7 GHz+

    Popularity: 8% [?]

  • 0 Comments
  • Filed under: Gecko, IT