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 ?packets
In article
<37559f82-5ef4-4fa8-bfea-39dd06dc5d39@f63g2000hsf.googlegroups.com>,
David Schwartz <davids@webmaster.com> wrote:

> On Mar 20, 4:48 pm, Rick Jones <rick.jon...@hp.com> wrote:
> 
>
> That's several orders of magnitude worse than what he's doing.
> Consider a typical packet of data received, how many system calls he
> needs, and how many system calls that needs.
>
> There is, also, one other huge difference. Posting larger reads
> doesn't change when your process is made ready-to-run. Whether you try
> to read one byte or one thousand, you will become ready-to-run at the
> same time. He is looking for a way to change when his process becomes
> ready-to-run -- he's looking to make it later. That wastes CPU time he
> could be using to process the packet(s) he has already received.

It sounded like some kind of audio processing application.  There's no
point in processing the packets faster than they can be played, you're
just going to get blocked on the output side.  If you don't need to
process packets as soon as they arrive, some savings could be achieved
if the recv's could be batched up.

However, I think the OP's worries are overblown.  While there have been
operating systems that had considerable overhead to switch between user
and kernel modes (comparable to switching between processes), I think
most modern Unixes use pretty efficient mechanisms.  Rather than having
completely separate user and kernel address maps, they use the same
address map and just flip some permission bits (so that when you're in
user mode you don't have access to the kernel portion of the addres
space).

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***

Report this thread to moderator Post Follow-up to this message
Old Post
Barry Margolin
03-22-08 12:19 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:28 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.