Is real-time programming can be done with C# & .Net?
-
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
-
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
-
tnx! i really hoped to take the advantages of the C# lang', but i guess it is impossible. maybe someone will make it possible in the future.
-
Look for a good C++ class library (ask in the c++ forum). The automatic memory management of NET will never be doable in an RT system because the app cannot run while the GC is moving everything around.
-
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
-
maybe there is an option to controll the GC... do you know something about it? but is the GC is the only thing that makes NET uncompatable for RT system ? what are the other things? tnx very much for all youe response...
eninyo wrote:
maybe there is an option to controll the GC... do you know something about it?
There is not. You can force a collection but excluding exceptional circumstances* you shouldn't because you'll generally worsen your apps performance, but there is no way to prevent the runtime from calling it whenever it feels a need to do so. AFAIK, the GC is the only true killer for an RT system. The standard .net timer is only good to ~10ms resolution, but there are more CPU itensive alternatives available in win32 (see multimedia timer) that can provide finer grained control at the cost of 20-50% cpu load for the timer alone. * ie getting rid of something like ArrayOfFiftyMillionInts.
-
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
No just for the fact its an Enterprise Framework that potentially generated MSIL and CLR byte-code thats run on some type of 'virtual machine' runtime. Its like Java all over again but imho alot cleaner.
-
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
There indeed is the GC that you must be careful for, but... you can design your app to not create any garbage. There are several ways to achieve this: one is to do object pooling, so you put objects back in the pool when you want to get rid of them. The other one is to use structs for temporary objects that are created on the stack.
Wout
-
There indeed is the GC that you must be careful for, but... you can design your app to not create any garbage. There are several ways to achieve this: one is to do object pooling, so you put objects back in the pool when you want to get rid of them. The other one is to use structs for temporary objects that are created on the stack.
Wout
hi' tnx for yours reply. i posted this Q long while ago and it nice to still get replys. anyhow, your solution look nice but still - the GC will invoke to check if there something to clean in that case also. and then it will halt all others task without any warrning. therefor, the solution to create object pooling will be great idea but the GC will invoke anyway although there won't be anything to clean. after alot of answer i got the big picture - at this moment microsoft doesn't suuport RT development. i think it won't support it in the future too, because microsoft decided to concentrate on web-development. in that case. VS.Net 2005 is a great tool. yours, Eli
-
hi' tnx for yours reply. i posted this Q long while ago and it nice to still get replys. anyhow, your solution look nice but still - the GC will invoke to check if there something to clean in that case also. and then it will halt all others task without any warrning. therefor, the solution to create object pooling will be great idea but the GC will invoke anyway although there won't be anything to clean. after alot of answer i got the big picture - at this moment microsoft doesn't suuport RT development. i think it won't support it in the future too, because microsoft decided to concentrate on web-development. in that case. VS.Net 2005 is a great tool. yours, Eli
eninyo wrote:
at this moment microsoft doesn't suuport RT development. i think it won't support it in the future too, because microsoft decided to concentrate on web-development. in that case. VS.Net 2005 is a great tool.
MS has never supported RT dev because windows is not, and never has been, an RT OS. The .net GC makes the situation somewhat worse, but even native apps don't have any RT promises due to the vagarities of the scheduler.
-
hi' tnx for yours reply. i posted this Q long while ago and it nice to still get replys. anyhow, your solution look nice but still - the GC will invoke to check if there something to clean in that case also. and then it will halt all others task without any warrning. therefor, the solution to create object pooling will be great idea but the GC will invoke anyway although there won't be anything to clean. after alot of answer i got the big picture - at this moment microsoft doesn't suuport RT development. i think it won't support it in the future too, because microsoft decided to concentrate on web-development. in that case. VS.Net 2005 is a great tool. yours, Eli
Hmmm, digging in my memory I think the GC only goes to work if garbage actually exists. But you'll have to dig into the documentation to verify that yourself! I give my memory an 80% chance that it's right ;)
Wout
-
Hmmm, digging in my memory I think the GC only goes to work if garbage actually exists. But you'll have to dig into the documentation to verify that yourself! I give my memory an 80% chance that it's right ;)
Wout
tnx. i'll try to dig in to it, but it make sence that it is working anyhow. i mean that if there is no garbge, the GC doesn't know it, in order to verify that there is nothing to clean it has to invoke, therefore i'm not sure you right. i will check it anyhow. i find it very hard to get knowlage about the GC (i mean real and theoretical information), so if you can help me with that i'll be be thankful. tnx for all your answer...
-
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
Just what do you mean by real-time? How 'hard' are your constraints? In general you cannot get real-time performance from a Windows system ( and that's before you consider the issues caused by managed code with automatic garbage collection ). Please refer to this excellent article here on code project: http://www.codeproject.com/system/simpletime.asp[^] Regards, Dan
Remember kids, we're trained professionals.
Don't try this at home! -
hello to you all, i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains. is there a way to meke RT apps with C#? or the .net framework is not RT compadable? i really love to hear a response to this important issue. tnx in advance, Eli
One other characteristic of C# to keep in mind is that JIT compilation introduces unpredictable execution times. This is probably more noticeable in small embedded environments such as WinCE platforms. I have experienced "hits" of 100+ msec while small functions are compiled, other times they require only 20+ msecs to execute. Apparently the WinCE CLR provides only a relatively small buffer (64K?) of compiled code. When this becomes full, something must be purged to compile the next new block. So you see the "hit" somewhat unpredictably. Also no way to generate pre-compiled binaries (genx) in WinCe.
-
One other characteristic of C# to keep in mind is that JIT compilation introduces unpredictable execution times. This is probably more noticeable in small embedded environments such as WinCE platforms. I have experienced "hits" of 100+ msec while small functions are compiled, other times they require only 20+ msecs to execute. Apparently the WinCE CLR provides only a relatively small buffer (64K?) of compiled code. When this becomes full, something must be purged to compile the next new block. So you see the "hit" somewhat unpredictably. Also no way to generate pre-compiled binaries (genx) in WinCe.