Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: socket programming using MSG_WAITALL for receiving multicast
On Mar 20, 4:44 pm, Barry Margolin <bar...@alum.mit.edu> wrote:

> What does the scheduler have to do with this?

The scheduler determines when the process runs after it is made ready-
to-run by reception of the first datagram.

> He's not talking about
> process switches, he's talking about context switches between user and
> kernel mode when calling recvfrom().

When you make a call into the kernel, the largest component of the
time it takes will be time spent running other processes (if any are
chosen to run).

> There is overhead when going into and out of the kernel, but in this
> case there's nothing you can do about it.  There's no system call for
> getting the datagrams that have been buffered all at once.

You are right, but there are two separate issues. One is how long will
the receive function take if another process is scheduled, another is
how long it will take if not.

It's hard to know exactly what the OP is thinking here. But a modern
CPU can easily do millions of system calls per second. So unless he's
processing a *lot* of packets, the overhead due to switching into
kernel space should be tolerable. I just benchmarked my dual P3-1Ghz
system -- it can do 7,000,000 system calls per second. System call
latency is much less than a microsecond.

I was thinking his main issue was that his program would run every
time a packet was received, thus increasing process churn on his
system resulting in poor performance both for him and everyone else.
If his sole concern was number of system calls, yeah, there's nothing
he can do about that.

DS

Report this thread to moderator Post Follow-up to this message
Old Post
David Schwartz
03-21-08 03:13 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:00 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.