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

C#

 
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 
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 
jschell wrote:
Never understood that need. That can only apply if getting the item requires
acquiring other resources and in that case, especially given 5, then either make
the caller responsible for that or wrap it is a proxy and that does it.


I have a worker thread that monitors the queue. There is not always something in the queue. In fact, most of the time, it will be empty or close to it. Clearly, I should not spin the CPU when the queue is empty.

As for being able to cancel the blocking operation, well... if you wait on a syncronization object indefinitely (the blocking part), it keeps the thread alive (which will keep the process alive) [EDIT: unless the thread is a background thread]. Not a desirable behavior when you, say, want to be able to shut down your app Smile | :) .

Using a timeout is also not a solution, as if you set your timeout too low, you'll spin the CPU, and if you set it too high, you'll have that annoying behavior of your app taking a long time to shut down.


jschell wrote:
Its a generic class/API which means if there is a failure mode then it must
throw exceptions.


I wouldn't consider cancelling a blocking operation to be a failure if the cancellation was intended. But some would...

jschell wrote:
Not that hard
and I suspect there are a vast number of examples on the internet.


You'd be surprised Wink | ;) .
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 
QuestionRe: application register queries in sql file or in xml files. Pin
Eddy Vluggen7-Nov-14 2:58
professionalEddy Vluggen7-Nov-14 2:58 
AnswerRe: application register queries in sql file or in xml files. Pin
Ibrahim.elh7-Nov-14 3:29
Ibrahim.elh7-Nov-14 3:29 
GeneralRe: application register queries in sql file or in xml files. Pin
Eddy Vluggen7-Nov-14 7:27
professionalEddy Vluggen7-Nov-14 7:27 

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.