Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Jim Murphy
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Mike Woodring
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Pierre Greborio
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[])

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Mike Woodring
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Pierre Greborio
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Pierre Greborio
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Akshay Arora
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Simon Robinson
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Justin Rudd
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

Re: [ADVANCED-DOTNET] Socket class init within iexec.exe

2002-09-03 Thread Cavnar-Johnson, John
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Simon Robinson
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

Re: [ADVANCED-DOTNET] Socket class init within iexec.exe

2002-09-03 Thread Chris Kinsman
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

Re: [ADVANCED-DOTNET] Exclusive access to unmanaged resource

2002-09-03 Thread Chris Kinsman
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.

Re: [ADVANCED-DOTNET] CAS: what's the diff between FullTrust and Everything permission sets?

2002-09-03 Thread Pinto, Ed
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

Re: [ADVANCED-DOTNET] Calling Destructor Explicitly in C++

2002-09-03 Thread Mike Woodring
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

Re: [ADVANCED-DOTNET] Impersonating a Custom Principal (haha)

2002-09-03 Thread Brady Gaster
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

Re: [ADVANCED-DOTNET] Calling Destructor Explicitly in C++

2002-09-03 Thread Lidor Wyssocky
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Jon Stonecash
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

[ADVANCED-DOTNET] Exclusive access to unmanaged resource

2002-09-03 Thread Steve Sharrock
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

Re: [ADVANCED-DOTNET] Impersonating a Custom Principal (haha)

2002-09-03 Thread chad . gross
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Ian Griffiths
"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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Mike Woodring
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Mike Woodring
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

Re: [ADVANCED-DOTNET] Calling Destructor Explicitly in C++

2002-09-03 Thread Alex Ivanoff
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Jim Murphy
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Stoyan Damov
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Marco Dorantes Martinez
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: [

Re: [ADVANCED-DOTNET] Sockets, .Net Remoting take > 1min. for init in IEEXEC.EXE

2002-09-03 Thread Mark Boulter
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"

Re: [ADVANCED-DOTNET] Impersonating a Custom Principal (haha)

2002-09-03 Thread Brady Gaster
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Craig Andera
> 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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Simon Robinson
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Simon Robinson
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Ian Griffiths
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

[ADVANCED-DOTNET] Sockets, .Net Remoting take > 1min. for init in IEEXEC.EXE

2002-09-03 Thread John Davis
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

Re: [ADVANCED-DOTNET] Calling Destructor Explicitly in C++

2002-09-03 Thread Wyssocky, Lidor
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-

[ADVANCED-DOTNET] Deployment Project Bug (?) : max 32 dependencies?

2002-09-03 Thread Truan Hick
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

Re: [ADVANCED-DOTNET] Calling Destructor Explicitly in C++

2002-09-03 Thread Simon Robinson
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Nauman Laghari
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

Re: [ADVANCED-DOTNET] Socket class init within iexec.exe

2002-09-03 Thread Robert J. van der Boon
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Joe Duffy
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

Re: [ADVANCED-DOTNET] Connection pool help needed badly...

2002-09-03 Thread Blain Timberlake
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:

Re: [ADVANCED-DOTNET] Connection pool help needed badly...

2002-09-03 Thread Blain Timberlake
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

[ADVANCED-DOTNET] Implementing a Callback Interface in C++ Managed Class

2002-09-03 Thread Wyssocky, Lidor
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

Re: [ADVANCED-DOTNET] ThreadPool with WebRequest exception

2002-09-03 Thread Ed Stegman
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Curtis Koppang
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

Re: [ADVANCED-DOTNET] Threading is blocking itself or ?

2002-09-03 Thread Ed Stegman
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

Re: [ADVANCED-DOTNET] sealed: why?

2002-09-03 Thread Jesse Liberty
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

Re: [ADVANCED-DOTNET] CAS: what's the diff between FullTrust and Everything permission sets?

2002-09-03 Thread Shawn A. Van Ness
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

Re: [ADVANCED-DOTNET] Threading is blocking itself or ?

2002-09-03 Thread Hun Boon
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

Re: [ADVANCED-DOTNET] CAS: what's the diff between FullTrust and Everything permission sets?

2002-09-03 Thread Chris Sells
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: