activity wholist changelog info
now if you've got a pair of headphones...
you'd better get 'em on and get 'em cranked up
I really am stunned that anyone thinks this is a worthwhile use of time.

Stunned is one word for it. Dismayed is another. Take your pick.

Tags: ,
music: rob zombie - dragula

So I had this code that did essentially:
for (int i = 0; i < num_files; i++)
    if ((fd = open(files[i]->name, O_RDONLY)))
        do_stuff(fd);
And I figured, hey, I've got an I/O scheduler and my disks have command queueing now, let's mitigate some of that seek death and do multiple stuffs in parallel. Well, here in ***america*** where fork() is cheap you'd do:
for (int i = 0; i < num_files; i++) {
    if (num_kids == MAX_KIDS)
        wait(NULL);
    if ((fd = open(files[i]->name, O_RDONLY))) {
        if (!fork()) {
            do_stuff(fd);
        } else {
            num_kids++;
        }
    }
    while (waitpid(-1, NULL, WNOHANG) > 0)
        num_kids--; 
}
while (num_kids--)
    wait(NULL);
And then it's off to the bar. For some reason I thought that maybe doing it in pthreads would be a good exercise, and tried it that way first. (Actually I tried POSIX AIO zeroth. Ha! Good one, guys. You almost got me.) That went something like:
for (int i = 0; i < num_files; i++) {
    if ((fd == open(files[i]->name, O_RDONLY)))
        pthread_create(&thread[min_thread_index], NULL, do_stuff, (void *)fd);
    /* hmm, how to throttle thread creation? */
    pthread_join(&thread[i % MAX_KIDS], NULL); /* bonghits in the hood */
    /* and then reset min_thread_index somehow? ugh */
}
Except that doesn't work, because you can only join with named threads, and not just whichever one happens to die first. I have no idea how long each of these threads is actually going to take, so round-robin is a waste of time. I could stick in a semaphore that every thread downs on init and ups on termination, and block the dispatch loop on that, but that's still not enough, since then I still need to figure out - somehow - which thread died so I can reuse its slot in thread[]. Why pthread_create() doesn't just return the new pthread_t is beyond me.

Of course ideally we'd have waitfd() that was smart enough to cope with thread IDs too, and you'd message the thread ID back out to the master process somehow, and you'd still have to allocate your own pthread_t's anyway. Hooray for unix.

Tags: ,
music: nine inch nails - gave up

The Symbian Foundation: Because you didn't have enough bad free software already.

Tags:
music: hybrid - higher than a skyscraper

Not, of course, that anyone should mistake The Register for journalism, but the article on Red Hat's desktop strategy is right about 580 nm on the "yellow" scale. For those of you not keeping score, we haven't released anything that could be called consumer desktop product in over five years. If this counts as "scurrying away" from a market, I wonder how they feel about the rapid decline of OS/2 in recent years.

Tags:

To whoever made it so you can't /nick when you're in a channel you can't send to: please die in a chemical fire.

Tags:
music: outkast - love hater

yeah, we'll get right on that.

Tags:
music: combichrist - what the fuck is wrong with you?

1. Enter nationality.
2. Enter rental period and locations.
3. Select desired vehicle.
4. -ETIMEDOUT.

HELLO I HAVE MONEY I WANT TO GIVE YOU. PLEASE HELP ME GIVE YOU MONEY.

But no, these guys are novices:



Give up. Find another industry. Software is clearly not for you.

Tags:
music: cracker - i hate my generation

$ ph
Adam Jackson
User: ajaxxx
Name: Adam Jackson
$ cat .plan
gpg: DD38 563A 8A82 2453 7D1F 90E4 5B8A 2D50 A0EC D0D3
$ nm -D
$ cal
Back November 2010
123456
78910111213
14151617181920
21222324252627
282930
page summary
tags