Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

The Internet

benad's Journal: jabberd2: Well D'uh

Journal by benad
Now that my G4 is back to a sane operating volume, I was able to relax a bit, noticing how much I missed loading web pages in less than a second.

Also, I came over jabberd2, as I had some trouble setting up the multi-user conference module.

While setting up the "muc", I realized that I just added a module without havng to do anything special, and that module is running a separate process. It's as if you could add an apache2 module without having to restart httpd or anything.

So I looked at the source code. And guess what, it seems I'm not alone thinking this way.

The trick is simple: if your process is more I/O bound than CPU bound, use non-blocking I/O and block when you want with select(). That works particularly well if processing the "packets" is done in constant time and that "slower packets" are processed in parallel processes. Like in jabberd2.

I'm fed up of seing every single TCP server using either forking processes or threads on every new connection. You don't have to do neither! jabberd2 has 5 processes, one thread per process, TOTAL.

Anyways, it's nice to see that some of the ideas I had for ANet were not that crazy...

- Benad

This discussion has been archived. No new comments can be posted.

jabberd2: Well D'uh

Comments Filter:

Shortest distance between two jokes = A straight line