Ben Bowen's Blog
• Home / Blog •
• About •
• Subscribe •
Software Engineering
Game Design
Personal
View All Tags
Popular Highlights
Common Multithreading Mistakes in C# - III: Unsafe Assumptions
February 2017
// An in-depth look at exactly what the CPU and runtime can do to subvert us when we don't write properly thread-safe code
Fun With __makeref
May 2016
// Explanation on how to use hidden C# keywords to implement generic pointers and related functions
Simulating Multiple Inheritance In C#
February 2016
// A longform post describing the need for and implementation of MI in C#
Two Decades of C#: A Reference - C# 10
// Summarizing features in C# 10.
Software Engineering
• Saturday 22nd January 2022
.net
c#
Since C# was introduced in 2000 the language has grown immensely in size and I'm not sure it's possible for any one person to have intimate knowledge of
every
language feature in their head at all times. Therefore I wanted to write a series of quick reference posts summarizing all the major new language features ever since C# 2.0. I won't go in to detail with any of them, but instead I want this series to act as a reference for myself (and hopefully you too!) that I can go back to from time-to-time to remember what tools I have in the toolbox. :)...
Two Decades of C#: A Reference - C# 8
// Summarizing features in C# 8.
Software Engineering
• Sunday 28th March 2021
.net
c#
Since C# was introduced in 2000 the language has grown immensely in size and I'm not sure it's possible for any one person to have intimate knowledge of
every
language feature in their head at all times. Therefore I wanted to write a series of quick reference posts summarizing all the major new language features ever since C# 2.0. I won't go in to detail with any of them, but instead I want this series to act as a reference for myself (and hopefully you too!) that I can go back to from time-to-time to remember what tools I have in the toolbox. :)...
Two Decades of C#: A Reference - C# 5 and C# 6
// Summarizing features in C# 5 and C# 6.
Software Engineering
• Monday 22nd March 2021
.net
c#
Since C# was introduced in 2000 the language has grown immensely in size and I'm not sure it's possible for any one person to have intimate knowledge of
every
language feature in their head at all times. Therefore I wanted to write a series of quick reference posts summarizing all the major new language features ever since C# 2.0. I won't go in to detail with any of them, but instead I want this series to act as a reference for myself (and hopefully you too!) that I can go back to from time-to-time to remember what tools I have in the toolbox. :)...
C# 8 Concerns - A Followup
// Revisiting the C# 8 Concerns post from two months prior
Software Engineering
• Tuesday 13th November 2018
.net
c#
About two months ago I made a post explaining some concerns I had with two new features in C# 8 (the range/hat operator and default interface methods). If you haven't read that post, I recommend reading it first before coming back here: C# 8 Concerns....
Postmortems - Tale of Two Casts
// A deep-dive in to a rare difference between the way the CLR and C# handle a given cast
Software Engineering
• Thursday 1st June 2017
.net
c#
About a year ago I came across a bug that took me a while to get to the bottom of. Look at the following code and see if you can predict the output:...
Postmortems - Absolutely Wrong
// An investigation in to a small bug encountered when creating Escape Lizards
Software Engineering
• Wednesday 10th May 2017
c#
When handling input for XBOX controllers in Escape Lizards, I had to tilt the level/environment according to the direction the left analog stick was being held. The left-analog stick's position is returned via the XInput API as two 16-bit signed integers (
short
s), one for each axis (
x
and
y
)....
Common Multithreading Mistakes in C# - III: Unsafe Assumptions
// An in-depth look at exactly what the CPU and runtime can do to subvert us when we don't write properly thread-safe code
Software Engineering
• Saturday 11th February 2017
multithreading
performance
c#
cheap
swisswatch.to
carryout a unbelievably upmarket high-level perplexing presents take pleasure in.aaa+
www.wellreplicas.to
.
https://www.tomtops.ru/
have always been concerned about a trend for watchmakers carry forward its fine traditions infused with strong momentum.
https://www.valentinoreplica.ru/
are commonly replicated on the market.high quality
cheap carolina herrera
is absolutely qualified to compare with the masterpiece of palace-level art..these
https://www.vancleefarpelsreplica.ru/
are not only perfectly authentic.luxury
https://www.movadowatch.to/
watch instruction older the watchmaking industry experts.
datewatches.com
forum development schedule unique is most effective.
In this series, I'm going to be elucidating some common errors C# programmers make when working with multithreaded systems. I'll be exploring issues from a lower-level point-of-view, and not dabbling too much in higher-level abstractions and libraries (such as the TPL and similar); hopefully the points raised will be pertinent to anyone hoping to write concurrent or parallelized applications....
Common Multithreading Mistakes in C# - I: Incorrect Granularity
// A higher-level overview of the lock keyword and how it is commonly misused
Software Engineering
• Sunday 3rd July 2016
multithreading
performance
c#
In this series, I'm going to be elucidating some common errors C# programmers make when working with multithreaded systems. I'll be exploring issues from a lower-level point-of-view, and not dabbling too much in higher-level abstractions and libraries (such as the TPL and similar); hopefully the points raised will be pertinent to anyone hoping to write concurrent or parallelized applications....
Three Garbage Examples
// Three examples and explanations of situations that can create unnecessary garbage in .NET4/C#5
Software Engineering
• Friday 8th April 2016
performance
.net
c#
C# (and any language that runs on the CLR) is a garbage-collected language, meaning that objects that have no references to them remaining will have their memory reclaimed at some point in the future. Creating too much garbage (by creating too many ephemeral objects or over-using the
new
keyword) can induce the garbage-collector too frequently, slowing down the entire application....
P/Invoke Tips
// Assorted accrued tips on using P/Invoke in C#
Software Engineering
• Monday 18th January 2016
native interop
performance
.net
c#
Not very many C# programmers will ever need to do much with P/Invoke (Microsoft's technology for interoperation with legacy or native codebases), but for those of us who do, I've amassed a few little tips that aren't always included in the various tutorials found on the 'net....
Two Decades of C#: A Reference - C# 9
// Summarizing features in C# 9.
Software Engineering
• Wednesday 31st March 2021
.net
c#
Since C# was introduced in 2000 the language has grown immensely in size and I'm not sure it's possible for any one person to have intimate knowledge of
every
language feature in their head at all times. Therefore I wanted to write a series of quick reference posts summarizing all the major new language features ever since C# 2.0. I won't go in to detail with any of them, but instead I want this series to act as a reference for myself (and hopefully you too!) that I can go back to from time-to-time to remember what tools I have in the toolbox. :)...
Two Decades of C#: A Reference - C# 7
// Summarizing features in C# 7.
Software Engineering
• Thursday 25th March 2021
.net
c#
Since C# was introduced in 2000 the language has grown immensely in size and I'm not sure it's possible for any one person to have intimate knowledge of
every
language feature in their head at all times. Therefore I wanted to write a series of quick reference posts summarizing all the major new language features ever since C# 2.0. I won't go in to detail with any of them, but instead I want this series to act as a reference for myself (and hopefully you too!) that I can go back to from time-to-time to remember what tools I have in the toolbox. :)...
Two Decades of C#: A Reference - C# 2, 3 and 4
// Summarizing features in C# 2, C# 3 and C# 4.
Software Engineering
• Friday 19th March 2021
.net
c#
Since C# was introduced in 2000 the language has grown immensely in size and I'm not sure it's possible for any one person to have intimate knowledge of
every
language feature in their head at all times. Therefore I wanted to write a series of quick reference posts summarizing all the major new language features ever since C# 2.0. I won't go in to detail with any of them, but instead I want this series to act as a reference for myself (and hopefully you too!) that I can go back to from time-to-time to remember what tools I have in the toolbox. :)...
C# 8 Concerns
// Elucidation on some concerns with upcoming new features planned for C# 8
Software Engineering
• Saturday 15th September 2018
.net
c#
In the following post I'm going to talk about two concerns I have with features planned for C# 8. Beforehand though, I just want to point out a couple of things: Also for previous subscribers, I'm sorry for the huge hiatus in blogging. I've been busy with work and all my spare time has been going in to patching my game. That's finally done however so hopefully normal service will be resumed. :)...
Postmortems - Clearly Too Slow
// An example of a simple everyday operation that needed micro-optimising in my game engine
Software Engineering
• Wednesday 24th May 2017
performance
c#
In my game engine, the following code was called once every frame for every material in the game. We had an average of about 500 materials in most scenes; so on a high-end machine this one function was being called about
100,000 times a second
. C# can definitely handle it (ask any high-scale web developer), but as you can imagine the method had to be fast (especially as we wanted to support average-to-low-end desktops):...
Common Multithreading Mistakes in C# - IV: Everything Else
// A look at some miscellaneous unexpected gotchas when writing multithreaded code
Software Engineering
• Sunday 23rd April 2017
multithreading
performance
c#
In this series, I'm going to be elucidating some common errors C# programmers make when working with multithreaded systems. I'll be exploring issues from a lower-level point-of-view, and not dabbling too much in higher-level abstractions and libraries (such as the TPL and similar); hopefully the points raised will be pertinent to anyone hoping to write concurrent or parallelized applications....
Common Multithreading Mistakes in C# - II: Unnecessary Contention
// Exploring the basics of what makes different approaches to parallelism more or less efficient
Software Engineering
• Friday 14th October 2016
multithreading
performance
c#
In this series, I'm going to be elucidating some common errors C# programmers make when working with multithreaded systems. I'll be exploring issues from a lower-level point-of-view, and not dabbling too much in higher-level abstractions and libraries (such as the TPL and similar); hopefully the points raised will be pertinent to anyone hoping to write concurrent or parallelized applications....
Fun With __makeref
// Explanation on how to use hidden C# keywords to implement generic pointers and related functions
Software Engineering
• Friday 13th May 2016
performance
c#
C#'s list of keywords is ever-growing, but there is also a set of four hidden (dark) keywords that have been in the language since its earliest days that not so many people are aware of. Those keywords are: Today we'll be looking at
__makeref
and its two companion keywords
__reftype
and
__refvalue
. We won't be looking at
__arglist
today....
Simulating Multiple Inheritance In C#
// A longform post describing the need for and implementation of MI in C#
Software Engineering
• Sunday 21st February 2016
oop / api design
c#
Before I begin, I need to point out that this post is lengthy, and is written as a kind of "journey through examples". This is for those who want to understand the reasoning behind the eventual final implementation and perhaps learn about C# along the way. If you, like me, prefer to jump straight to some source code, you can skip to the final implementation first (use the table-of-contents on the right), and perhaps come back after. :)...
© Ben Bowen 2016 to
DateTime.Now
•
About
•
Subscribe
•
RSS