Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
PIEBALDconsult30-May-10 16:19
mvePIEBALDconsult30-May-10 16:19 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
Hamed Musavi30-May-10 8:53
Hamed Musavi30-May-10 8:53 
AnswerRe: Blocking vs. Non-Blocking Socket efficiency? Pin
harold aptroot30-May-10 9:00
harold aptroot30-May-10 9:00 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
Hamed Musavi30-May-10 9:02
Hamed Musavi30-May-10 9:02 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
harold aptroot30-May-10 9:13
harold aptroot30-May-10 9:13 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
harold aptroot30-May-10 9:26
harold aptroot30-May-10 9:26 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
Hamed Musavi30-May-10 9:28
Hamed Musavi30-May-10 9:28 
AnswerRe: Blocking vs. Non-Blocking Socket efficiency? Pin
Luc Pattyn30-May-10 10:23
sitebuilderLuc Pattyn30-May-10 10:23 
When you use your own threads, you are in charge. You can do whatever pleases you; the price for that is the expense of a thread. Each thread needs its own context, consisting mainly of a stack, which by default takes 1MB of memory.

When you use asynchronous operation, you are relying on how they implemented that. .NET asynchronous operations use ThreadPool threads, which is a pool of threads with certain characteristics. The big advantage in using ThreadPool is you can get the same activity covered with fewer actual threads, which is great especially when you would need hundreds or thousands of them, e.g. because you have that number of sockets, or timers, or serial ports.

There are disadvantages too, of course. You can't change most of the ThreadPool characteristics, e.g. stack size, thread priority, etc. And you can't change the dynamic behavior of the ThreadPool; it will start with only a few active threads, and the way they implemented it, it will detect heavy load and add more threads at a fixed rate of only 2 per second. There are some parameters one can set, but they are few because the ThreadPool is used by .NET itself, hence it needs to get launched long before your first line of managed code executes.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
Hamed Musavi30-May-10 18:25
Hamed Musavi30-May-10 18:25 
GeneralRe: Blocking vs. Non-Blocking Socket efficiency? Pin
Luc Pattyn31-May-10 1:48
sitebuilderLuc Pattyn31-May-10 1:48 
QuestionUnix Time Pin
jojoba201130-May-10 7:39
jojoba201130-May-10 7:39 
AnswerRe: Unix Time Pin
PIEBALDconsult30-May-10 8:34
mvePIEBALDconsult30-May-10 8:34 
AnswerRe: Unix Time Pin
Kristian Sixhøj30-May-10 9:09
Kristian Sixhøj30-May-10 9:09 
QuestionRe: Unix Time Pin
jojoba201130-May-10 21:07
jojoba201130-May-10 21:07 
AnswerRe: Unix Time Pin
Kristian Sixhøj31-May-10 2:34
Kristian Sixhøj31-May-10 2:34 
GeneralRe: Unix Time Pin
Daniel Grunwald31-May-10 8:14
Daniel Grunwald31-May-10 8:14 
AnswerRe: Unix Time Pin
PIEBALDconsult31-May-10 5:25
mvePIEBALDconsult31-May-10 5:25 
Questionignore special chars in string Pin
michaelgr130-May-10 7:11
michaelgr130-May-10 7:11 
AnswerRe: ignore special chars in string Pin
Hamed Musavi30-May-10 7:14
Hamed Musavi30-May-10 7:14 
AnswerRe: ignore special chars in string Pin
Abhinav S30-May-10 7:31
Abhinav S30-May-10 7:31 
GeneralRe: ignore special chars in string Pin
yu-jian30-May-10 15:06
yu-jian30-May-10 15:06 
AnswerRe: ignore special chars in string Pin
Abhinav S30-May-10 18:25
Abhinav S30-May-10 18:25 
GeneralRe: ignore special chars in string Pin
yu-jian31-May-10 1:38
yu-jian31-May-10 1:38 
QuestionCopy Excel columns or rows into an Array in C sharp programme Pin
Kutilya30-May-10 0:47
Kutilya30-May-10 0:47 
AnswerRe: Copy Excel columns or rows into an Array in C sharp programme Pin
Garth J Lancaster30-May-10 1:33
professionalGarth J Lancaster30-May-10 1:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.