Mailinglist Archive: opensuse (2459 mails)

< Previous Next >
Re: [opensuse] GSOC 2008
  • From: debayan <debayanin@xxxxxxxxx>
  • Date: Fri, 21 Mar 2008 02:17:41 +0530
  • Message-id: <1206046061.6860.24.camel@xxxxxxxxxxxxxx>
Ok please answer this, say i ping the broadcast address (on
my lan) on the terminal, how does the OS execute the ping? Does it fork
off new processes or does it use threads? I am sure it is not sequential
because it is pretty fast.
Now if it is not sequential, i dont really need to use threads in my
program. I just have to execute a broadcast ping. The switch takes care
of the rest i think.

On Thu, 2008-03-20 at 21:42 +0100, Anders Johansson wrote:
debayan wrote:
No but even if you fork off separate processes, you get non-blocking IO
programs using pipes.... why use threads just for that then??

Wait, I just read what you actually wrote and not what I thought you wrote

Forking off multiple processes to do the scanning would be hideously
ineffective compared to using threads. Unlike what "Sam" told you,
threads are far more efficient than multiple processes on linux (on any
operating system). There is a reason why threads are sometimes referred
to as "light weight processes".

Also, what does "non-blocking IO using pipes" have to do with anything?
I'm not even sure what it means. Are you talking about the select() call
not blocking? It wasn't IPC I was talking about when I said that things
blocked. Multithreaded programming is just a basic tool all programmers
use to make the most of the hardware we have.

Some programs don't need it, but very many do. Almost all you see on
your desktop uses multithreaded programming. Linux would suck on SMP if
it didn't

Debayan Banerjee
NIT Durgapur, West Bengal, India

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >