वैसे, मोनो महान है, लेकिन जहां तक मैं देख सकता हूं, यह अस्थिर है। यह काम करता है, लेकिन दोष जब आप मोनो प्रक्रिया को एक गंभीर काम करने के लिए देते हैं।
TL; DR - यदि आप मोनो का उपयोग नहीं करते हैं:
- मल्टीथ्रेड वातावरण में AppDomains (असेंबली लोड \ Unload) का उपयोग करें
- 'लेट-इट-फेल' मॉडल को बनाए नहीं रख सकते
- प्रक्रिया चलाने के दौरान कभी-कभी भारी-भार वाली घटनाओं का अनुभव करें
तो, तथ्य।
हम RHEL5, Ubuntu, और, मेरे दृष्टिकोण से मोनो-2.6.7 (.net v 3.5) का उपयोग करते हैं, यह नोवेल द्वारा निर्मित सबसे स्थिर संस्करण है। इसमें अनलोडिंग एपडोमेंस (सेगफॉल्ट्स) के साथ एक मुद्दा है, हालांकि, यह बहुत दुर्लभ है और यह, अब तक, स्वीकार्य है (हमारे द्वारा)।
ठीक है। लेकिन अगर आप .net 4.0 की सुविधाओं का उपयोग करना चाहते हैं, तो आपको संस्करण 2.10.x, या 3.x पर स्विच करना होगा, और यहीं से समस्याएं शुरू होंगी।
2.6.7 की तुलना में, नए संस्करणों का उपयोग करने के लिए अस्वीकार्य है। मैंने मोनो प्रतिष्ठानों के परीक्षण के लिए एक सरल तनाव परीक्षण एप्लिकेशन लिखा।
यह यहाँ है, उपयोग करने के निर्देश के साथ: https://github.com/head-thrash/stress_test_mono
इसमें थ्रेड पूल वर्कर थ्रेड्स का उपयोग किया गया है। कार्यकर्ता AppDomain को dll लोड करता है और कुछ गणित-कार्य करने की कोशिश करता है। कुछ काम कई-थ्रेडेड होते हैं, कुछ सिंगल होते हैं। लगभग सभी काम सीपीयू-बाउंड होते हैं, हालांकि डिस्क से फ़ाइलों के कुछ रीड होते हैं।
परिणाम बहुत अच्छे नहीं हैं। वास्तव में, संस्करण 3.0.12 के लिए:
- sgen GC segfaults प्रक्रिया लगभग तुरंत
- बोहम के साथ मोनो लंबे समय तक रहता है (2 से 5 घंटे तक), लेकिन अंततः सेगफॉल्ट्स
जैसा कि ऊपर बताया गया है, sgen gc सिर्फ काम नहीं करता है (स्रोत से निर्मित मोनो):
* Assertion: should not be reached at sgen-scan-object.h:111
Stacktrace:
Native stacktrace:
mono() [0x4ab0ad]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x2b61ea830cb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x2b61eaa74425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x2b61eaa77b8b]
mono() [0x62b49d]
mono() [0x62b5d6]
mono() [0x5d4f84]
mono() [0x5cb0af]
mono() [0x5cb2cc]
mono() [0x5cccfd]
mono() [0x5cd944]
mono() [0x5d12b6]
mono(mono_gc_collect+0x28) [0x5d16f8]
mono(mono_domain_finalize+0x7c) [0x59fb1c]
mono() [0x596ef0]
mono() [0x616f13]
mono() [0x626ee0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a) [0x2b61ea828e9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x2b61eab31ccd]
Boehm segfauls के लिए - उदाहरण के लिए (Ubuntu 13.04, मोनो स्रोत से निर्मित):
mono: mini-amd64.c:492: amd64_patch: Assertion `0' failed.
Stacktrace:
at <unknown> <0xffffffff>
at System.Collections.Generic.Dictionary`2.Init (int,System.Collections.Generic.IEqualityComparer`1<TKey>) [0x00012] in /home/bkmz/my/mono/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:264
at System.Collections.Generic.Dictionary`2..ctor () [0x00006] in /home/bkmz/my/mono/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:222
at System.Security.Cryptography.CryptoConfig/CryptoHandler..ctor (System.Collections.Generic.IDictionary`2<string, System.Type>,System.Collections.Generic.IDictionary`2<string, string>) [0x00014] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/Crypto
Config.cs:582
at System.Security.Cryptography.CryptoConfig.LoadConfig (string,System.Collections.Generic.IDictionary`2<string, System.Type>,System.Collections.Generic.IDictionary`2<string, string>) [0x00013] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/CryptoCo
nfig.cs:473
at System.Security.Cryptography.CryptoConfig.Initialize () [0x00697] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs:457
at System.Security.Cryptography.CryptoConfig.CreateFromName (string,object[]) [0x00027] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs:495
at System.Security.Cryptography.CryptoConfig.CreateFromName (string) [0x00000] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs:484
at System.Security.Cryptography.RandomNumberGenerator.Create (string) [0x00000] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs:59
at System.Security.Cryptography.RandomNumberGenerator.Create () [0x00000] in /home/bkmz/my/mono/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs:53
at System.Guid.NewGuid () [0x0001e] in /home/bkmz/my/mono/mcs/class/corlib/System/Guid.cs:492
या (आरएचईएल 5, मोनो आरपीएम से लिया गया है यहां ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home%3A.vmas%3A/mono-centos5 )
Assertion at mini.c:3783, condition `code' not met
Stacktrace:
at <unknown> <0xffffffff>
at System.IO.StreamReader.ReadBuffer () [0x00012] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.IO/StreamReader.cs:394
at System.IO.StreamReader.Peek () [0x00006] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.IO/StreamReader.cs:429
at Mono.Xml.SmallXmlParser.Peek () [0x00000] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/Mono.Xml/SmallXmlParser.cs:271
at Mono.Xml.SmallXmlParser.Parse (System.IO.TextReader,Mono.Xml.SmallXmlParser/IContentHandler) [0x00020] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/Mono.Xml/SmallXmlParser.cs:346
at System.Security.Cryptography.CryptoConfig.LoadConfig (string,System.Collections.Generic.IDictionary`2<string, System.Type>,System.Collections.Generic.IDictionary`2<string, string>) [0x00021] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Security.Cryptog
raphy/CryptoConfig.cs:475
at System.Security.Cryptography.CryptoConfig.Initialize () [0x00697] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs:457
at System.Security.Cryptography.CryptoConfig.CreateFromName (string,object[]) [0x00027] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs:495
at System.Security.Cryptography.CryptoConfig.CreateFromName (string) [0x00000] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs:484
at System.Security.Cryptography.RandomNumberGenerator.Create (string) [0x00000] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs:59
at System.Security.Cryptography.RandomNumberGenerator.Create () [0x00000] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs:53
at System.Guid.NewGuid () [0x0001e] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System/Guid.cs:483
at System.Runtime.Remoting.RemotingServices.NewUri () [0x00020] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:356
at System.Runtime.Remoting.RemotingServices.Marshal (System.MarshalByRefObject,string,System.Type) [0x000ba] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:329
at System.AppDomain.GetMarshalledDomainObjRef () [0x00000] in /usr/src/redhat/BUILD/mono-3.0.3/mcs/class/corlib/System/AppDomain.cs:1363
दोनों विफलताएं किसी तरह से AppDomains तर्क से जुड़ी हैं, इसलिए, आपको मोनो में उनसे दूर रहना चाहिए।
BTW, परीक्षण किए गए प्रोग्राम ने बिना किसी असफलता के MS .NET 4.5 env में विंडोज मशीन पर 24 घंटे काम किया।
इसलिए, निष्कर्ष में, मैं कहना चाहूंगा - सावधानी के साथ मोनो का उपयोग करें। यह पहली नज़र से काम करता है, लेकिन जब भी आसानी से विफल हो सकता है। आप ओपन सोर्स परियोजनाओं में कोर डंप और प्रमुख विश्वास हानि के एक समूह के साथ छोड़ दिया जाएगा।