Home > Uncategorized > Immutable data structures in C#

Immutable data structures in C#

Immutable data structures are well known in the functional domain but they are not that common in imperative languages like C#. A good thing about immutable objects in general is that many threads may access them in parallel (without using any locks). This is possible since they never change and thus no raise conditions can occur. As an excercise, I sat down and implemented three different immutable data structures in C#; a stack, a list and a graph. You may download the source code here.

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: