Click here to Skip to main content
15,911,789 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionAbout timeseries plot Pin
mahabir25-Jul-08 19:22
mahabir25-Jul-08 19:22 
AnswerRe: About timeseries plot Pin
Paul Conrad2-Aug-08 21:03
professionalPaul Conrad2-Aug-08 21:03 
QuestionSetting a timeout time for MarshalByRefObject? Pin
jeffb4225-Jul-08 10:48
jeffb4225-Jul-08 10:48 
AnswerRe: Setting a timeout time for MarshalByRefObject? Pin
Mark Salsbery25-Jul-08 11:51
Mark Salsbery25-Jul-08 11:51 
GeneralRe: Setting a timeout time for MarshalByRefObject? Pin
jeffb4225-Jul-08 13:57
jeffb4225-Jul-08 13:57 
QuestionAny good way to update an object reference plus something else in a single CompareExchange? Pin
supercat925-Jul-08 8:00
supercat925-Jul-08 8:00 
AnswerRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
Mike Dimmick28-Jul-08 0:47
Mike Dimmick28-Jul-08 0:47 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
supercat928-Jul-08 5:50
supercat928-Jul-08 5:50 
Mike Dimmick wrote:
32-bit processors support 32-bit interlocked operations; 64-bit processors in 64-bit mode support 64-bit interlocked operations and that's it.


The 32-bit processors support a CMPXHG8 instruction for 64-bit compare-exchange. That's what's used when performing CompareExchange on a long integer. So there is no hardware impediment to providing an "Object-plus" compare-exchange in .net.

As for 64-bit architectures, the question would be whether they need to use a full 64 bits for an object reference. I can't really see any reason that should be necessary.

Lock-free programming in general is difficult, though some cases are pretty easy (e.g. a singly-linked list in which either insertions or deletions are restricted to the start of the list). Allowing a CompareExchange on an "Object-plus" would allow convenient handling of more data structures.

The problem with locks isn't just one of performance, but also one of stability. While it's certainly possible to use locks safely, the more widely they're used, the greater the likelihood of deadlock, priority inversion, or other such problems. Certainly there are places where locks are more practical than non-locking methods, but using locks within a class can create tricky behavioral dependencies which need to be documented and dealt with. If a non-blocking approach can yield the same result, such dependencies are eliminated.
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
Luc Pattyn28-Jul-08 7:00
sitebuilderLuc Pattyn28-Jul-08 7:00 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
supercat928-Jul-08 9:37
supercat928-Jul-08 9:37 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
led mike28-Jul-08 9:53
led mike28-Jul-08 9:53 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
Luc Pattyn28-Jul-08 10:09
sitebuilderLuc Pattyn28-Jul-08 10:09 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
supercat928-Jul-08 15:20
supercat928-Jul-08 15:20 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
Luc Pattyn28-Jul-08 16:05
sitebuilderLuc Pattyn28-Jul-08 16:05 
GeneralRe: Any good way to update an object reference plus something else in a single CompareExchange? Pin
supercat928-Jul-08 15:54
supercat928-Jul-08 15:54 
Questionrounding to five decimal digits Pin
CICCIOLO6924-Jul-08 22:50
CICCIOLO6924-Jul-08 22:50 
Answercross-post Pin
Luc Pattyn25-Jul-08 5:18
sitebuilderLuc Pattyn25-Jul-08 5:18 
Answer[Cross Post]Re: rounding to five decimal digits (with link to original message) Pin
Scott Dorman25-Jul-08 5:21
professionalScott Dorman25-Jul-08 5:21 
AnswerRe: rounding to five decimal digits Pin
ghle26-Jul-08 5:47
ghle26-Jul-08 5:47 
QuestionWindows Service : More than one user Service may run within the same process Pin
Krugger40424-Jul-08 21:48
Krugger40424-Jul-08 21:48 
Answer[Cross Post]Re: Windows Service : More than one user Service may run within the same process Pin
Scott Dorman25-Jul-08 4:18
professionalScott Dorman25-Jul-08 4:18 
GeneralRe: [Cross Post]Re: Windows Service : More than one user Service may run within the same process Pin
Krugger40425-Jul-08 11:01
Krugger40425-Jul-08 11:01 
GeneralRe: [Cross Post]Re: Windows Service : More than one user Service may run within the same process Pin
Scott Dorman25-Jul-08 14:15
professionalScott Dorman25-Jul-08 14:15 
QuestionPlease Clear my doubt !! Pin
guriqbal8724-Jul-08 2:37
guriqbal8724-Jul-08 2:37 
AnswerRe: Please Clear my doubt !! Pin
Luc Pattyn24-Jul-08 3:09
sitebuilderLuc Pattyn24-Jul-08 3:09 

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.