MonoInterface(80%)-needs testing, docs, minor tweaks
C# wrapper code(90%) - needs testing
CMake integration (50%) - C# related files are missing
CMake mono module (70%) - Works only under Linux
MonoNullAI (100%) - works
MSAI (MonoSampleAI) (25%)
Wiki pages (~20%)
Folder structure: AI/Interfaces/MonoInterface/ -->Provides an AI interface for CLI AIs AI/Wrappers/CSharp/ -->Wrapper code written in C#, AI developer who want to program there AIs in a CLI*2 compatible language should use this code.
Extra software required for using and developing CLI AIs: Mono >2.0.1 (2.0 should work, too but it has some bugs) GLib2 (Mono dependency) Extra software required for building: Mono-devel >2.0.1 (2.0 should work, too but it has some bugs) GLib2-devel (Mono dependency)
Due problems with native to managed pointers I was rewriting half of the code. While I did this I found out (with the help of hoijui) that it is impossible to use C++ pointer for C pointer. So I had to rewrite the complete handling of native to managed functions in C. Due to this I decided to move from C++ to C because C is faster and Mono expects char*'s not std::string's and the conversion from (const) char*/std::string was to much for me.
At the end I rewrite the complete MonoInterface in C. Half of it is done. Error/warning/info handling is missing and native to managed calling.
I worked on the C part of the Interface until I faced a problem yet unknown. Calling Mono api functions in the init event of SAILibrary crashes spring. But if I call it in the init or loadSAILibrary function of the interface it works. The init where the crash happens is past to the SAILibrary struct in loadSAILibrary as a function pointer. I don't know if it happens because of a thread issue (dead locked resources, but I call a mono function "mono_thread_attach" which should fix it if it is a thread issue) or due the possibility that mono can not be used in function pointers. Where are 6 threads running at the time of the crash. 2 SDL threads doing nanosleep(); 2 MonoVM threads, one doing a *_wait() and one poll() 1 OpenAL I think nanosleep(); 1 Spring thread where the error happens. Maybe someone has an idea :S I will try some tactics to figure out what is wrong. - Writing a program which loads the MonoVM through a function pointer - And a test program for testing the thread issue possibility.
At the moment my PC is not working because I installed and uninstalled various packages which caused some trouble to the GUI :S. I wanted to setup my PC new anyway. Until it is setup I will write some awk script to generate a C# wrapper....
And the windows support needs to wait until the Linux version works basically. The windows support will also be more difficulty.
After long time I finally finished the basics of the MonoAIInterface.
At the moment it should load any CLI compiled .dll with a runtime version 1.0 or 2.0.
I have a problem with handleEvent which is called more than 30 times a second which I think triggers this exceptions after a few seconds: SIGPWR (Power fail/restart) and then SIGXCPU (CPU time limit exceeded) repeats again after a few seconds. But it does not crash spring. I can press okay and continue.
On the managed side I run this command: Console.WriteLine("TeamID: " + teamId + " Topic: " + topic); This will be written to the console on each handleEvent call. Means more than 30 times per second.
From the mono project side: "SIGPWR, SIGXCPU: these are used internally by the GC and pthreads."
Maybe someone can help with this problem.
Edit: wikipedia: On some operating systems, the Boehm garbage collector uses SIGXCPU and SIGPWR to synchronise cross-thread garbage collection.
The MonoAIInterface is nearly finished thanks to very much help from hoijui and some people from #monodev on gimpnet. What is left: Documentation, optimize (free memory/ better algorithm) and some more options in the lua file. And of course some testing...
At the moment I'm searching for a good license which does not bite GPL and has a copyleft. So far LGPL seems the best... But feel free to suggest a better license.
Regarding SIGPWR and SIGXCPU - I run into yet unresolved problems with mono GC in spring downloader tracker. GC was freezing whole program and was spamming those signals. It was more likely with many threads and asynchronous IO operations. Other large scale mono projects suffer from it too - for example for hosting ASP.NET aplication under mono, its recommended to restart apache module every few hours :)
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum