Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2006

Tip: Looking for answers? Try searching our database.

VC++ Vs .Net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mubashir Khan - 05 Oct 2006 08:40 GMT
Ok ... Ok hold on. This is not the same old discussion. But it still is. I
am creating an application which would open 100+ sockets. Every socket would
be emulating a user for a telnet connection thus response should be real
time. This is the reason i have created one thread for each socket. I
remember I/O completion port can be used to create fewer threads using
thread pool, but i would be researching for it and i have got very little
time to complete it. My Question, I want better performance and less
computer resource usage. What do u guys suggest ........ VC++ or .Net
Peter Duniho - 05 Oct 2006 08:53 GMT
> [...] I remember I/O completion port can be used to create fewer threads
> using thread pool, but i would be researching for it and i have got very
> little time to complete it. My Question, I want better performance and
> less computer resource usage. What do u guys suggest ........ VC++ or .Net

According to the .NET documentation and statements posted here by others,
the non-blocking implementation of the .NET Socket class uses IOCP.  If your
goal is to use IOCP, it seems to me that using .NET is probably one of the
easiest ways to do that, since it's Socket API is fairly simple.

Implementing IOCP code in regular C++, using only Winsock and without the
assistance of 3rd-party libraries, is not only a chore, it's complex and
fraught with potential pitfalls and opportunities for errors.

If coding IOCP using plain C++ and the Win32 Winsock API is within your
capabilities, then using the async methods in the Socket class should be
trivial for you.  We're talking weeks to get it right under C++, versus a
day or so under .NET (more or less, depending on your actual capabilities as
a coder).

Full optimizations and possibly other details may take longer, of course.
I'm just talking about the basic implementation.  But that may well be
sufficient for your needs, and even if it's not, I suspect that any extra
stuff will have a similar relative cost using Win32 versus .NET.

Pete
Carl Daniel [VC++ MVP] - 05 Oct 2006 15:30 GMT
> Ok ... Ok hold on. This is not the same old discussion. But it still
> is. I am creating an application which would open 100+ sockets. Every
[quoted text clipped - 5 lines]
> want better performance and less computer resource usage. What do u
> guys suggest ........ VC++ or .Net

It's not an either-or proposition.  The .NET sockets implementation uses
IOCPs for async operation and is very highly scalable - use it.

Whether you use it from C++, C# or any other .NET language is a completely
separate decision.

-cd
Chris Mullins - 06 Oct 2006 03:34 GMT
> I  am creating an application which would open 100+ sockets. [...]
> response should be real time.

> This is the reason i have created one thread for each socket.

Ah! Don't do it. You're hurting yourself. Repeat after me: IOCP. IOCP. IOCP.

> I remember I/O completion port can be used to create fewer threads using
> thread pool, but i would be researching for it and i have got very little
> time to complete it.

It's quicker and less bug prone to write it using IOCP in .Net, than it is
to do it using mulitple threads.

> My Question, I want better performance and less computer resource usage.
> What do u guys suggest ........ VC++ or .Net

.Net. Hands down.

Then run it on x64 and really make it cool...

Signature

Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.