Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

jabberd2: Well D'uh

benad (308052) writes | more than 10 years ago

The Internet 0

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.

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

cancel ×

0 comments

Sorry! There are no comments related to the filter you selected.

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>