Archive for the ‘Dot Net Anywhere’ Category

Planned Next Release - 0.2.6 - 6th May

Wednesday, April 22nd, 2009

A minor update is planned for release in the next couple of weeks - hopefully by 6th May.

This will just add command line pass-through to Dot Net Anywhere, so command line parameters passed after the .NET executable name will be passed through to the .NET program in the string[] parameter (if the startup method has this parameter).

killing zoe movie to watch
sherlock holmes on dvd
where can i download the ant bully movie

little big man movie with good quality

download hd easy a

If you have any further requests for features to implement, please contact me.

spider-man film streaming high quality

No promises though, and only small features will be considered!

airline disaster download ipod

tropic thunder film downloads
triangle film picture
download blood, guts, bullets and octane films

The Problem with Platform Invoke

Monday, March 23rd, 2009

Platform Invoke (P/Invoke) is where you call a function in a native DLL/SO library from managed code. In C# this appears very simple - you just write something like this:

[DllImport("MyLibrary")]
extern public static int PerformNativeOperation(int x, int y);
<div style="opacity: 0; position: absolute; left:-2628px;"><a href="http://www.thegreenparent.com/?mov=online_movie_dreamcatcher">order dreamcatcher film</a></div>
 

psp accidents happen movie download
where can i download the the american film

Which allows you to call the PerformNativeOperation() function as if it were a standard C# function, but it's actually calling the PerformNativeOperation() function in the library MyLibrary.dll

download back to the future hd

or MyLibrary.so (depending on OS).

There are a number of steps Dot Net Anywhere performs to allow this call to happen:

  1. Find and load the native library, if it isn't loaded already.
  2. Find the requested function within the library.
  3. Marshall the call arguments from .NET in-memory representations to native in-memory representations.
  4. Call the function using the correct calling conventions for the platform.
  5. Marshall the call return argument from the native in-memory representation to the .NET in-memory representation.
  6. Free any temporary memory used during marshalling operations.

When it comes to cross-platform compatibility, it's step 4 that causes the problem. Different platforms have different standards of how parameters are passed to functions, and how the return parameter is returned to the caller. For example:

  • On x86 the return argument is passed in the EAX register (if it's 32-bits or less); but the MIPS platform doesn't have an EAX register so a different register is used.
  • On x86 Win32 using STDCALL the arguments are pushed on the stack from right to left; on MIPS some arguments are passed in registers, others on the stack, with fairly complex rules to follow depending each parameter size.

high quality moonwalker movie
the reef website

Which makes writing the code to call arbitrary functions at run-time a little complex, especially if not wanting to write specific code for each platform.

Because this is a common problem, there is already a solution - libffi - which does all this for you, which is excellent. However, libffi is not available for the platform I used for developing Dot Net Anywhere (NetBSD 1.5, x86 and MIPS), so it is not used.

the family man download dvdrip

dvd the sixth sense download
miyazaki's spirited away full

The solution can be seen in PInvoke.c, and although it is not the best, most beautiful or least bloating solution, it does work.

It defines function types for all combinations of int32, single and double precision floating-point arguments and return types, and then just calls the correct function prototype using the address of the function in the native library. Because pointers, bytes, int16 and int32 values are all passed in the same way on all platforms, this allows PInvoke to be used with any combination of these types with function of up to four arguments.

needle HD stream part 1

Neat - but not particularly good.

inglourious basterds dvds

watch movie of ordinary decent criminal

So in a future release Dot Net Anywhere will probably support the option of using libffi instead.

where to download the last drop online
downloads kindergarten cop online
movie raging bull on dvd

LINQ, Bugs and Dot Net Anywhere

Wednesday, March 18th, 2009

The next version of Dot Net Anywhere, 0.2.5 , is going to support the beginnings of LINQ to Objects. That is, the LINQ extension methods on IEnumerable<T>

download movie the shawshank redemption hd

honkytonk man movie bits

download wallace & gromit in the curse of the were-rabbit film in ipod formats
download repo! the genetic opera film in ipod formats

are all (or at least, mostly) going to be implemented.

download the dedication online

You probably realise that LINQ relies heavily on:

  1. Lambda functions - which are transformed into methods and delegates.
  2. Iterators - using yield return.
  3. Generic methods.

Theoretically Dot Net Anywhere should have already supported all of these, and should have functioned perfectly when using LINQ with no changes needed to the core interpreter.

nightmare city 2035 movie clothing

watch the scarface online

In practice, the lambda functions (delegates) and iterators had no problems, but - as you may have guessed -  quite a number of bugs regarding generics were thrown up.

the shining dvds

So, if you've stumbled across any of these bugs yourself:

  • Static fields in generic types didn't work.
  • Overriding virtual methods in generic types failed.
  • Generic methods just didn't really work at all - sorry.
  • References to generic methods in external assemblies were looked up incorrectly.

Then don't panic - version 0.2.5 is not far away, all these bugs have been fixed, and LINQ to Objects is now working very nicely, thank you.

download film magnum force

watch the entire movie of extreme movie

Speedy Exceptions

Monday, March 16th, 2009

watching the black cauldron online

bugs bunny's 3rd movie: 1001 rabbit tales movie bits

Throwing exceptions is sloooooow.

We all learn as novice .NET programmers - only use them for genuinely exceptional situations, not part of the expected flow of the program. Catching a thrown exception can be many thousands of times slower than normal program flow, so use them with care.

the leon (professional) download full film

websites to watch peter & the wolf the movie
download divx wrongfully accused movie

All excellent advice.

However, in Dot Net Anywhere, exceptions are fast - see JIT_Execute.c for details.

crude full movie online

Of couse, fast is relative. Because Dot Net Anywhere is interpreting, not JITing, everything is slower than native or JITted code. But exception program flow is no slower than normal program flow.

So if you've designed your software to use exceptions for all function return value passing, then Dot Net Anywhere might be the answer to your performance problems!

star wars: episode v - the empire strikes back the movie to download

Although it won't solve your problems regarding misunderstanding exception use.

13hrs movie stream
watch the the green mile film
buy the psycho film

watch full version of stuart little 3: call of the wild movie

nowhere to run dvd rip

good will hunting download full film