The really simple fix is to manually limit the size of the input queue.
Ideally this should be a semaphore in the threadpool manager class that
you can block on if there are too many items in the queue.
You can do that by using a semaphore outside the threadpool. Increment
it every time you add
Well, I'm not sure I'd say that the thread pool isn't designed for massive
calls, so much as I'd say your computer isn't :-) I'm reasonably certain
that if you were to ignore the thread pool and instead use a custom solution
consisting of a queue for recording pending for work requests along with
You are right, that piece of code is unrealistic. Anyway, I made these
tests because I made a complex application that get a large number of
data from Internet (more than 1 milions of links) and I get the same
behaviour (Exception). I thought to use a simple and static number of
threads (Thread[])
I'm not sure what to suggest at this point that hasn't already been pointed
out. It all comes down do physics :-) The code you posted is highly
artificial and places an unrealistic burden on the thread pool manager.
It's unreasonable for you to expect that any thread pool manager can handle
"all
I found a different behaviour on my machine. The memory requested gets
no more than 200MB (I have 1GB Ram) and the number of threads exceed 31
threads. As I replayed to Nauman, if I have to limit/control the number
of calls, why should I have to use ThreadPool class ? That class is
responsable of
Well. The number of threads in the pool is fized, but I can queue how
many calls I need. The ThreadPoll must (should) manage the queue and
execute all calls depending of the number of threads available. If I
need to control the number of calls, I should I have to use ThreadPool
class ?
Thanks
Pie
Simon and others,
Inheritance is such a difficult topic to just tackle as this, but these
terms and definitions exist for a reason. People that crated them knew
exactly what they were doing, and these practices are in place because
in the end they make sense, though some might argue. I argue quit
Mike
Most of your points I think are covered by my reply to Ian.
But one other point. You say:
> Furthermore, in the absence of planned polymorphism via overridable
methods
> in the base class, the derive type developer's reuse model is reduced to
> delegation; by providing new methods on the de
Craig Andera stated:
> I have to ask: how many people here *have* derived classes from those in
> the framework?
I have. But only from the ones that were meant to be inherited from -
ServiceBase, Installer, CollectionBase, etc. (notice nothing from the
System.Windows.Forms namespace).
> But I
Do you really consider it a bug that Microsoft implemented Internet
Explorer to follow the HTTP 1.1 spec?
-Original Message-
From: Chris Kinsman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 1:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Socket class init with
Hi Ian
> So, are you in the "no, not all methods should be virtual" camp? If so,
> can't you see that having classes unsealed by default is equally
dangerous.
No I'm not in the 'all methods should be virtual' camp. But I think
the issues are rather different for methods. Firstly, there is
the p
I bet this is on the money. We ran into many issues with the default
HTTP/1.1 connection limit for our application which makes heavy use of
embedded controls. In our case we found a registry hack which increases
the number of HTTP/1.1 connections that IE uses and our problem went away.
Check ou
How about a Mutex or ReaderWriterLock depending on the type of locking...
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
FullTrust has the property of being everything, even things that aren't
defined, like custom permissions not yet known and APTC. Any other
permission set can only be what's in the list and can't, AFAIK, include
APTC.
Isn't this is why we can't use CAS to make identity demands of remoted
callers
Explicitly calling a destructor in native C++ will not free the memory for
the object itself. It just executes the destructor logic like a call to any
other method. What mechanism are you using to determine that there are no
leaks? For example, the C++ run-time library uses its own heap manager
Yes, it needs to be cross-domain. There's a lot of servers in the
environment that will be using this, and they're usually on different
domains.
Yes, we can lock IE. (or at least let's assume it just for sake of argument,
since you've peeked my interests)
Brady Gaster
Executive Technology Servic
They do. Of course the native library is more complicated then this simple
sample. However, the fact that calling the destructor explictly released
all the memory allocated for this unmanaged object seems strange. Doesn't
it?
Lidor
You can read messages from the Advanced DOTNET a
I have been reading Jeffrey Richter's Applied Microsoft .Net Framework
Programming (which I recommend highly). In Part IV, Chater 12: Working with
Text, Page 256, Richter says, "For performance reasons, the String type is
highly integrated with the CLR. Specifically, the CLR knows the exact
layo
I'm working on a Web Service that depends on some legacy (Unmanaged) 32bit
DLLs (MFC) to resolve some of the requests. In some cases I should really
acquire exclusive access to some of these unmanaged resources. In years
past, on a platform far, far away, I would have used something like a
shared
Brady,
With your single signon solution, does it need to cross domains with it's
authentication or will all apps be part of the same domain? For example:
1) www.mydomain.com/app1, www.mydomain.com/app2, or
2) app1.mydomain.com, app2.mydomain.com
OR
1) www.mydomai
"Simon Robinson" <[EMAIL PROTECTED]> wrote:
> Hi Ian
>
> Haven't you killed your own argument with this statement?
>
> > you only discover what makes a good base class for any
> > particular application when you try to use your existing
> > class as a base class and find out what is wrong with it
There are a few things at play here:
(1) the default thread limits in the ThreadPool implementation
(2) the default connections-per-domain limit in the HttpWebRequest class
(3) the default queue limit in the ThreadPool implementation
(1) and (2) have been addressed in this thread already. (3) m
For the record, I side with Ian & Craig. Now onto a specific reply
(below)...
From: "Simon Robinson" <[EMAIL PROTECTED]>
>
> I'd have said that even if you feel your class is imperfect, then by
> not having it as sealed you give other developers the freedom to
> derive from it and save themselve
I just compiled and ran the code you provided and delete m_p worked. There
must be something else in your code. If you are wrapping up the existing
library make sure they use the same runtime libraries (debug vs. release
and multithreaded vs. singlethreaded.
On Mon, 2 Sep 2002 18:17:52 +0300, Wy
Welcome to the world of multithreading in .NET. :) The threadpool size
is a real pain but it isn't as bad as you may think.
To be fair your example is pretty tough and not that realistic.
ExplicitCall() is an extremely tight loop and generates an extremely
high number of work items when compared
Ok, I've tried it.
I am not sure if the threads are the problem here.
My app launched 31 threads, but they stayed 31 for about 15 seconds,
while the VM size was constantly increasing, until finally got to about
500MB.
Then, I got the same exception, but I think that this has more to do
with memor
I have found that inheritance relationship works great for me when I
think about it as "BEHAVE AS" more than "IS A" between the related
classes.
-Original Message-
From: Craig Andera [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 9:12 AM
To: [EMAIL PROTECTED]
Subject: Re: [
This is caused by a deadlock in System.Configuration. The long time is
the time it takes to time out the deadlock. There are a couple of ways
to avoid this issue:
1. Force config initialization at the begining of the program (this line
will do the trick):
ConfigurationSettings.GetConfig("foo"
Yes, but I'm sure the fee isn't cheap. That was another one of the
"requirements," you know.
Brady Gaster
Executive Technology Services
[EMAIL PROTECTED]
480.575.3625 office
602.790.2081 mobile
> -Original Message-
> From: Mark Burns [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 30
> I have to ask: how many people here *have* derived classes from those
in
> the
> framework?
I never have.
> But I absolutely think that inheritance is misunderstood, hazardous,
and
> frequently misapplied. (I've misapplied it often enough myself in the
> past.) I also think it's a good deal
Hi Ian
Haven't you killed your own argument with this statement?
> you only discover what makes a good base class for any
> particular application when you try to use your existing class as a base
> class and find out what is wrong with it.
If you mark a class as sealed, how is anyone going to
Hi Jesse
In the particular case of String, according to Richter's book
CLR has knowledge of the internal design of String is
hardcoded into the CLR for performance reasons, which is
why String has to be sealed.
I think there was a discussion about this topic a month or
so ago on one of the Devel
If people try to derive from your class and as a result they discover that
you need to refactor the base class, then it doesn't make much difference
whether it was originally sealed or not. You have to modify the base class
in any case.
Not sealing it only really buys you anything in the case wh
I think you're right! But the only problem is that I am using a config
file. I guess this means I am missing an entry. I spent a good part of the
weekend combing through the possible settings and couldn't find anything
that related to Sockets.
I am glad to see that Dave Adair had the same prob
I'm sure. But even if I did, it doesn't explain why calling the unmanaged
destructor explicitly frees the memory...? Any thoughts?
Thanks,
Lidor
Lidor Wyssocky
Software Infrastructure and Tools
NDS Technologies Israel
E-Mail: [EMAIL PROTECTED]
Phone: 972-
This is a weird problem, but has been reproduced.
We have a main application assembly, that in turn references the varios
assemblies that make up our application, this has grown to quite a large
number now.
Recently we noticed assemblies previously included due to an 'autodetected
dependency' we
Hi Lidor
Are you sure that between the constructor and the destructor you
haven't done something that has corrupted the memory around
the class you're trying to delete? (Or possibly even called delete
already from somewhere else). That looks the most likely
explanation to me.
Simon
Yes it has such limitation,
"The thread pool is created the first time you create an instance of the
ThreadPool class. The thread pool has a default limit of 25 threads per
available processor, which could be changed using CorSetMaxThreads as
defined in the mscoree.h file. Each thread uses the de
John,
I can't tell exactly what happens, but looking at the stacktrace, it seems
like reading the application's configuration file seems to be problem. The
first call to socket() tries to read a BooleanSwitch(), for which the
configurationfile needs to be read.
You're stating that it only happens
While I agree with you on many (all?) of the points made below, it all boils
down to the good ole' flexibility and power VS. shielding incompetent
programmers from themselves paradigm. Inheritance does _not_ have to be
perfect for it to work. Picture perfect class hierarchies are obviously
prefera
So if .fill fails, would it return a connection with an "active"
datareader back to the pool?
Thanks,
=Blain
-Original Message-
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED]] On Behalf Of Sigurdur G.
Gunnarsson
Sent: Monday, September 02, 2002 10:15 AM
To:
Hmmm...I had tried to prevent this from the beginning by keeping the
connection use as locoalized as possible. This is a fairly simple
service that I did, so that shouldn't be the problem. I've kept all the
connection stuff as isolated as possible. Thanks,
=Blain
-Original Message-
Fro
Hi,
I have a design problem with the interaction between managed and unmanaged
classes in MC++:
I have a native library written in C++. The library can notify client's code
about relevant events through a simple interface the client has to
implement.
Now I'm writing a managed wrapper to the nati
Looking at the source[1] for HttpWebReqest.BeginGetResponse(), it's by design.
I'd be interested to know:
1. Why throwing an exception here was deemed a good thing?
2. Why InvalidOperationException is being thrown instead of a more specific exception?
The genericity of InvalidOperationException
I like the performance argument and I agree with everything Ian had to say
except his conclusion ;-).
In many cases I am hoping people will TRY to derive from my classes and help
me to refactor the base class implementation. Is it really my job to
prevent someone from deriving in a way which I f
Gracias amigo. :-))
I'll pass this along.
A quick search shows , otherwise you nailed it.
-Ed
-Original Message-
From: TIAGO PASCOAL
Put something like this in machine.config or web.config
Not sure if the elements and attribute names are totally correct since i'm
working by memor
Ian,
All that is fine, but when Microsoft releases the String class as sealed,
they preclude the decision by a development team to specialize that class. I
just don't see why you would do so.
---
Jesse Liberty, President
Liberty Associates, Inc.
.NET Programming and T
Wow, thanks Joroen. I'll try to verify this tomorrow, but I suspect that's exactly my
scenario.
I found some explanation, if anyone else is interested...
http://msdn.microsoft.com/library/en-us/dnnetsec/html/v1securitychanges.asp
-S
On Mon, 2 Sep 2002 16:33:52 +0200, Jeroen Frijters <[EMAIL
If you want to programmatically control it,
Do the following:
ServicePointManager.DefaultConnectionLimit = 20; // increase from default 2 to 20
concurrent to the same site without following the
Http Spec.
Regards,
Hun Boon Teo
http://www.geocities.com/teohunboon
- Original Message -
Fr
FullTrust has the property of being everything, even things that aren't
defined, like custom permissions not yet known and APTC. Any other
permission set can only be what's in the list and can't, AFAIK, include
APTC.
Chris Sells
http://www.sellsbrothers.com/
> -Original Message-
> From:
50 matches
Mail list logo