Csharp Code Samples

Rohan’s Blog – C# .NET Programming
  • rss
  • Home
  • About
  • Search
  • Contact Me

Configuring WCF Throttling Behaviors

Rohan Warang | April 27, 2009

Most WCF services hosted in a live environment if not configured for handling heavy simultaneous requests give a Denial of Service Error, better known as DoS attacks. To prevent these from happening we have to configure the throttling behavior and some attributes of the ServiceHost.

Read the rest of this entry »

Comments
2 Comments »
Categories
Optimization
Tags
Behavior, Microsoft, Throttling, WCF
Comments rss Comments rss
Trackback Trackback

Efficient Server Side Paging Alternatives

Rohan Warang | April 20, 2009

Every one of us has used paging in our projects to display tabular data in DataGrids or GridViews or in the more recent and more flexible ListViews.

The problem we often face is when the data is less the paging works fine, but as the data starts to increase the page load times start increasing. The main reason for this is because we tend to bind the grids with entire data table and then use the built in functionality for paging.

This article describes how to effectively do server side paging by retrieving only a finite amount of data using the traditional stored procedure technique, but optimized for not being affected by volume of data, and an alternative method using the very famous linq framework.

Read the rest of this entry »

Comments
No Comments »
Categories
Optimization
Tags
Database, Linq, Linq to SQL, Paging, Stored Procedure
Comments rss Comments rss
Trackback Trackback

Thread Synchronization: Ensuring Atomic Operations

Rohan Warang | April 7, 2009

An atomic operation in computer science refers to a set of operations that can be combined so that they appear to the rest of the system to be a single operation with only two possible outcomes: success or failure (Wikipedia).

In a threaded application certain variables or objects may be shared by multiple threads. If these variables are accessed by two or more threads at the same time it will produce unpredictable results. These operations cannot be termed as atomic.

This article describes how to ensure atomic operations in a multi-threaded environment.

Read the rest of this entry »

Comments
2 Comments »
Categories
Tutorials
Tags
Atomic, Lock, Threading
Comments rss Comments rss
Trackback Trackback

Thread Synchronization: Avoiding Race Conditions

Rohan Warang | April 5, 2009

Race conditions occur when two or more threads try to gain control of the same object. In a threaded application multiple instances of threads run concurrently. These threads may share some variables such as counters or some other global objects. There is every chance that multiple threads simultaneously try to write values to the same object. This is known as a race condition.

Read the rest of this entry »

Comments
1 Comment »
Categories
Tutorials
Tags
Race Condition, Synchronization, Threading, Wait Handles
Comments rss Comments rss
Trackback Trackback

Subscribe

dZone

Categories

  • Optimization
  • Tutorials

Admin

  • Log in
Creative Commons License rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox