Click here to Skip to main content
15,887,376 members
Home / Discussions / C#
   

C#

 
GeneralRe: Waiting for thread to exit? Pin
SledgeHammer0110-Nov-14 9:27
SledgeHammer0110-Nov-14 9:27 
GeneralRe: Waiting for thread to exit? Pin
Eddy Vluggen11-Nov-14 0:31
professionalEddy Vluggen11-Nov-14 0:31 
AnswerRe: Waiting for thread to exit? Pin
Garth J Lancaster8-Nov-14 17:31
professionalGarth J Lancaster8-Nov-14 17:31 
QuestionAny library to decompress XZ files? Pin
DonRolando8-Nov-14 9:56
DonRolando8-Nov-14 9:56 
AnswerRe: Any library to decompress XZ files? Pin
Garth J Lancaster8-Nov-14 12:11
professionalGarth J Lancaster8-Nov-14 12:11 
QuestionSystem.Web.HttpContext cannot be serialized because it does not have a parameterless constructor. Pin
ASPnoob8-Nov-14 4:33
ASPnoob8-Nov-14 4:33 
AnswerRe: System.Web.HttpContext cannot be serialized because it does not have a parameterless constructor. Pin
Kornfeld Eliyahu Peter8-Nov-14 9:19
professionalKornfeld Eliyahu Peter8-Nov-14 9:19 
QuestionBlocking Collection Issue Pin
SledgeHammer017-Nov-14 8:24
SledgeHammer017-Nov-14 8:24 
My requirements are simple. I need something with the following:

* queue like behavior (FIFO)
* thread-safe
* blocking behavior for get item method
* blocking get item method should be cancellable (cancellationtoken, bool, etc)
* blocking behavior should be 0% CPU / non spinning (no sleeps)
* high performance

So, naturally, I went with BlockingCollectionT. This works fine, and meets all my requirements, however, when you use the cancellable Take(CancellationToken) and cancel the operation, you get 3 exceptions:

A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in System.dll

The first 2 are caught inside of the framework and the 3rd I catch in my code. This causes people to complain Frown | :( I tried explaining this is "expected behavior", but you know people...

I looked at BlockingCollectionT in ILSpy and it doesn't seem like its going to be possible to bypass the exception throwing. GOD, I hate APIs that throw exceptions for "normal" behavior.

Seems like everything that uses the cancellationtoken throws exceptions on cancellation?

Any other options that don't throw exceptions on a cancellation?
AnswerRe: Blocking Collection Issue Pin
Eddy Vluggen7-Nov-14 9:40
professionalEddy Vluggen7-Nov-14 9:40 
AnswerRe: Blocking Collection Issue Pin
jschell7-Nov-14 12:39
jschell7-Nov-14 12:39 
GeneralRe: Blocking Collection Issue Pin
SledgeHammer017-Nov-14 13:07
SledgeHammer017-Nov-14 13:07 
QuestionHow to calculate matrix determinant? n*n Pin
cicill7-Nov-14 6:18
cicill7-Nov-14 6:18 
AnswerRe: How to calculate matrix determinant? n*n Pin
OriginalGriff7-Nov-14 6:29
mveOriginalGriff7-Nov-14 6:29 
QuestionRe: How to calculate matrix determinant? n*n Pin
ZurdoDev7-Nov-14 10:11
professionalZurdoDev7-Nov-14 10:11 
Question[Howto] C# and DVR media port programming Pin
Benjie Fallar III7-Nov-14 5:26
Benjie Fallar III7-Nov-14 5:26 
GeneralRe: [Howto] C# and DVR media port programming Pin
Eddy Vluggen7-Nov-14 5:42
professionalEddy Vluggen7-Nov-14 5:42 
JokeRe: [Howto] C# and DVR media port programming Pin
PIEBALDconsult7-Nov-14 5:54
mvePIEBALDconsult7-Nov-14 5:54 
GeneralRe: [Howto] C# and DVR media port programming Pin
Benjie Fallar III7-Nov-14 6:00
Benjie Fallar III7-Nov-14 6:00 
GeneralRe: [Howto] C# and DVR media port programming Pin
Benjie Fallar III7-Nov-14 6:00
Benjie Fallar III7-Nov-14 6:00 
GeneralRe: [Howto] C# and DVR media port programming Pin
Eddy Vluggen7-Nov-14 7:24
professionalEddy Vluggen7-Nov-14 7:24 
GeneralRe: [Howto] C# and DVR media port programming Pin
Benjie Fallar III7-Nov-14 19:42
Benjie Fallar III7-Nov-14 19:42 
GeneralRe: [Howto] C# and DVR media port programming Pin
Eddy Vluggen8-Nov-14 3:27
professionalEddy Vluggen8-Nov-14 3:27 
Questionapplication register queries in sql file or in xml files. Pin
Ibrahim.elh6-Nov-14 23:50
Ibrahim.elh6-Nov-14 23:50 
QuestionRe: application register queries in sql file or in xml files. Pin
Eddy Vluggen7-Nov-14 0:26
professionalEddy Vluggen7-Nov-14 0:26 
AnswerRe: application register queries in sql file or in xml files. Pin
Ibrahim.elh7-Nov-14 1:52
Ibrahim.elh7-Nov-14 1:52 

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.