CSharpFeeds - All your C# feeds in one place.

Friday, July 03, 2009

Evil code of the day

by skeet via Jon Skeet: Coding Blog on 7/3/2009 10:28:26 PM

At a glance, this code doesn't look particularly evil. What does it do though? Compile it with the C# 4.0b1 compiler and run it... using System; class Base {     public virtual void Foo(int x, int y)     {         Console.WriteLine("Base: x={0}, y={1}", x, y);     } } class Derived : Base {     public override void Foo(i ...

[ read more ]

Multithreading: using fences from .NET code

by luisabreu via LA.NET [EN] on 7/3/2009 2:28:13 PM

In the last post, we’ve talked about memory fences. Today we’re going to keep looking at this topic, but we’re turning our attention to coding, ie, we’re going to talk about the options we have to add fences to our classes. In .NET, things are relatively straightforward. Whenever we use one of the interlocked methods we’ve met in the past, we’re adding a full fence to our code. Locking will also end up using full fences. As you can see,  you’re already using full fences in several places. ...

[ read more ]

Multithreading: introducing memory fences

by luisabreu via LA.NET [EN] on 7/3/2009 12:58:22 PM

A few posts back, we’ve introduced the concept of load and store reordering. As we’ve seen, reordering operations exist as a way of improving performance and can be introduced on several levels (starting at compilation time and ending at runtime when the processor executes the instructions). We saw that even though things can get chaotic quickly, there are some guarantees we can hold on to when writing multithreaded code. One of those guarantees is that all platforms respect a specific memory mo ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us