Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting concurrent java classes to c#

Tags:

java

c#

I'am trying to port high_scale_lib by Cliff Click
http://sourceforge.net/projects/high-scale-lib/
to c# but there is some java classes i can't find c# equivalent for it like

AtomicLongFieldUpdater

and what is the sun.misc.Unsafe type in java is it the same as pointer in c# or IntPtr ?
and my last question are all java objects are nullable ?

like image 864
user1748906 Avatar asked Aug 13 '26 01:08

user1748906


1 Answers

After having read the code, I even more strongly advise not to try to port it directly. The code as written does insane things with Java internals in an attempt to squeeze out razor thin margins of performance. The equivalent C# code might not perform as well, or different techniques might be needed to achieve the same results.

Basically: if you don't already understand exactly what that Java code is doing and why it is doing it that way (and I don't claim to understand it myself) then you're probably not qualified to attempt to port it to a different language on a different platform with a different memory model and different concurrency guarantees.

like image 114
Daniel Pryden Avatar answered Aug 14 '26 16:08

Daniel Pryden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!