Mailinglist Archive: opensuse (2459 mails)

< Previous Next >
Re: [opensuse] GSOC 2008
  • From: Sam Clemens <clemens.sam1@xxxxxxxxx>
  • Date: Thu, 20 Mar 2008 16:13:27 -0400
  • Message-id: <47E2C567.4010301@xxxxxxxxx>
debayan wrote:
Hmmmm, thats a guru talking. Yes you are correct. I was not aware of the
poor windows context switching in specific. Forking off separate
processes is fine. By the way, do you think the idea is good? Actually
whether it is accepted or not, we(
shall work on it anyways.

I think the overall project is a good idea.
I just think that using threaded code for this particular
problem is more trouble than it's worth.

If you REALLY want to work on threaded code...which is also
appropriately threaded... there are sections of the kernel
which are threaded....find an old computer that someone is
getting rid of, and play around with modifying those sections
of the kernel.

First rule of programming:
Decide on your project... THEN decide on the programming
techniques to use to implement the project.

In my college days, that's the strategy employed by my
Electrical Engineering professors. In contrast, my
Computer Science profs were generally.... lets just
say they would teach a programming technique, and then
assign projects for which the programming technique
required was usually one of the worst ways to implement
the project.

To choose your programming technique before even choosing
a problem to solve is, as they say, "putting the cart
in front of the horse."

On Thu, 2008-03-20 at 15:57 -0400, Sam Clemens wrote:
debayan wrote:
Well Sam, doing scans sequentially is a problem because if there is a
timeout, i must kill the process, so the subsequent scans get killed.
Forking off separate processes is a good idea, but i have used lan
scanners that use threads. I guess forking off new processes would be
fine because i am just pinging the broadcast address and the routing
software does the rest of the work. Also i am kinda interested to work
on threads. A while back i tried to make a ip address based lan scanner,
and i never got to finish it. Read up on threads later. Wanted to
implement it. I am aware that it is generates bugs. But just wanted to
Threading is something you use when the operating system has
extremely inefficient context switches (i.e. windows).
There's very little need for threading in the Unix/Linux world.

However, if you want to share some information between the
various processes, then grab some shared memory, and use
that, or use some sockets, or even named pipes out in /tmp.

Basically, threading is a hack designed to overcome the
grevious design flaws of the windows scheduler and
context switcher. And, as I said before, debugging threaded
code can be extremely difficult due to race conditions.

Just because a programming technique exists doesn't mean
that it should be used for your particular problem, in
the same way that you don't see anyone driving garbage
trucks in a grand prix race.

On Thu, 2008-03-20 at 15:31 -0400, Sam Clemens wrote:
debayan wrote:
I am one of those guys trying to spread Linux in the college. I use managed
to create a local repository
( ) which has helped, but most
of my friends do not want to switch to Linux because they would not want
to miss the games they play on Windows such as CounterStrike and Age of
Empires. So i began writing this program which scans the network every 1
minute or so for online game servers, and gives a popup alert in the
taskbar and gives info such as number of players online, IP address of
the server and the map that is on the server.
Though quite simple to implement and somewhat lame, its surprising how
effective it was in bringing new people to Linux.
I want to do this as a GSOC project. Want to add as many games as
possible. Will implement multiple scans using threads. I also envisage
adding features such as chatting on the game server. Would also like to
add a Gtk+ frontend. Skill required is C/C++ and sockets APIs. What do
you guys think? Is it a nice idea, or do i need to scratch my head more?
(I hope this mail is not too long)
Don't do use threading...either do the scans sequentially,
or just fork off multiple stand-alone processes. You gain
little by threading other than a ton of problems with from
conditions and other very subtle bugs.

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

< Previous Next >
Follow Ups