Slashdot Mirror


Protothreads and Other Wicked C Tricks

lwb writes "For those of you interested in interesting hard-core C programming tricks: Adam Dunkels' protothreads library implements an unusually lightweight type of threads. Protothreads are not real threads, but rather something in between an event-driven state machine and regular threads. But they are implemented in 100% portable ANSI C and with an interesting but quite unintuitive use of the switch/case construct. The same trick has previously been used by Simon Tatham to implement coroutines in C. The trick was originally invented by Tom Duff and dubbed Duff's device. You either love it or you hate it!"

2 of 229 comments (clear)

  1. Dosen't work as advertised! by Anonymous Coward · · Score: -1, Troll
    NAA Announces Corporate Downsizing and Administrative Reformation
    GNAA Announces Corporate Downsizing and Administrative Reformation

    Misha Borovsky (GNAP) - Hollywood - GNAA President timecop announced at a press conference this morning that the Gay Nigger Association of America is in the midst of a large effort to reduce operating costs and streamline business processes. "Layoffs of approximately fifty percent of the gay workforce are to be expected, as well as a shifting in administrative functions," timecop was quoted as saying. Analysts predict this corporate downsizing was made necessary due to over-investment into the New Orleans area, when it was announced last year that the GNAA would be opening a state-of-the-art branch office on the coast. The building was nearing completion and just opening for business when it was destroyed by hurricane Katrina, which has been recently found to be the responsibility of Jews. As George W. Bush is noted for not caring about black people, FEMA has refused to pay for the repairs, and the project was scrapped.

    "We are also making internal changes to the corporate information technology intranet," said supers, CTO for GNAA Worldwide Operations. "Many of our information moving processes were running on the Lunix platform, and this was generating large costs due to system slowness and instability. After a careful usability study, we have found that we will be saving millions of dollars [USD] per year by switching to the Microsoft Windows 2003 Server System".

    timecop ended the conference by announcing, "We'll always be there for the gay niggers of the world. With this restructuring of the organization, we are enabled to offer twice the service for a fraction of the cost. It's a new gay universe ahead."

    About GNAA:
    GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the first organization which gathers GAY NIGGERS from all over America and abroad for one common goal - being GAY NIGGERS.

    Are you GAY ?
    Are you a NIGGER ?
    Are you a GAY NIGGER ?

    If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!
    Join GNAA (GAY NIGGER ASSOCIATION OF AMERICA) today, and enjoy all the benefits of being a full-time GNAA member.
    GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the fastest-growing GAY NIGGER community with THOUSANDS of members all over United States of America and the World! You, too, can be a part of GNAA if you join today!

    Why not? It's quick and easy - only 3 simple steps!

    Talk to one of the ops or any of the other members in the channel to sign up today! Upon submitting your application, you will be required to submit links to your successful First Post, and you will be tested on your knowledge of GAYNIGGERS FROM OUTER SPACE.

    If you are having trouble locating #GNAA, the official GAY NIGGER ASSOCIATION OF AMERICA irc channel, you might be on a wrong irc network. The correct network is NiggerNET, and you can connect to irc.gnaa.us as our official server. Follow

  2. Re:Loop Abuse by slyborg · · Score: 0, Troll
    Hmm, I had a point I was trying to make with this post, but now it's escaped my mind... :-)
    That point being that you will never successfully mate and have offspring :)