Re: [ADVANCED-DOTNET] Async Sockets and Pinning

2006-08-09 Thread gregory young
Assuming you have a segment with a count of 0 :) While a stack will help localize things initially under heavy pressure you will need to be smarter (i.e. it is likely that none will be completely unused). As such you would have to remove all of the items from the queue/stack for that segment and w

Re: [ADVANCED-DOTNET] Async Sockets and Pinning

2006-08-09 Thread Sébastien Lorion
Just coming from the top of my head ... What about using a dictionary that keeps tracks of the number of reserved buffers for a given segment ? Something like this : in ctor(): _tracker = new Dictionary(); in CreateNewSegment(): _tracker.Add(segment, 0); in CheckOut(): _tracker[chunk.Array]++;

Re: [ADVANCED-DOTNET] Async Sockets and Pinning

2006-08-09 Thread gregory young
You are right, a stack would offer better locality of data. I am changing that now. "For the memory release problem, you could offer a manual TrimExcess() or a Trim(int segmentCount) method. What do you think ?" These methods would be very troublesome as you would have to insure that no buffers

Re: [ADVANCED-DOTNET] Async Sockets and Pinning

2006-08-09 Thread Sébastien Lorion
For the memory release problem, you could offer a manual TrimExcess() or a Trim(int segmentCount) method. What do you think ? Sébastien On 8/9/06, Sébastien Lorion <[EMAIL PROTECTED]> wrote: I really like your solution! Making this class a singleton as Yun Jin did seems not like a good choice b

Re: [ADVANCED-DOTNET] Async Sockets and Pinning

2006-08-09 Thread Sébastien Lorion
I really like your solution! Making this class a singleton as Yun Jin did seems not like a good choice because different scenarios will most probably require different parameters. Maybe a stupid idea, but I think using a stack would provide better cache locality since it will reuse the last buffe

Re: [ADVANCED-DOTNET] Async Sockets and Pinning

2006-08-09 Thread gregory young
After some research this seems like a much better method. Here is the BufferManager class ... you can use the new overloads for send/receive that take ArraySegments in conjunction with it. Yun Jin gives a great explanation of the problem I am trying to resolve here https://blogs.msdn.com/yunjin/a

Re: [ADVANCED-DOTNET] SQL output parameters

2006-08-09 Thread Shawn Wildermuth
It may be that the varchar(8000) was being converted to a text field. Try 'varchar(max)' as the datatype and it should work. Thanks, Shawn Wildermuth Wildermuth Consulting Services, LLC http://adoguy.com C# MVP, MCSD.NET, Author and Speaker > -Original Message- > From: Discussion of a

[ADVANCED-DOTNET] SQL output parameters

2006-08-09 Thread Shawn Brown
We have a stored procedure that uses a varchar(8000) as an output parameter. The stored proc was written in SQL 2000, and is called by .Net 1.0 clients. We copied the stored proc to a test server that has SQL Server 2005 installed, and are trying to write a client in Visual Studio 2005 using the .N

Re: [ADVANCED-DOTNET] ImageList problems with COM

2006-08-09 Thread Dean Cleaver
Andrew, I tried it with normal ,Net imagelist, and that failed. I tried the IPictureDisp trick, because that is what we have to do (via AxHost) to put bitmap images on Outlook buttons so wondered if it was the same COM issue. Also, I'm creating the imagelist on the fly in the constructor of the c

[ADVANCED-DOTNET] ImageList problems with COM

2006-08-09 Thread Eames, Andrew
IPictureDisp cannot be marshaled between COM apartments - I'll bet it has something to do with that Andrew -Original Message- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Dean Cleaver Sent: Tuesday, August 08, 2006 9:16 PM To: ADVANCED-DOTNET@DISCUSS.D