Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Work Issues
  4. Is real-time programming can be done with C# & .Net?

Is real-time programming can be done with C# & .Net?

Scheduled Pinned Locked Moved Work Issues
csharpdotnetvisual-studiohelpquestion
16 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eninyo
    wrote on last edited by
    #1

    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

    D G A W D 6 Replies Last reply
    0
    • E eninyo

      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

      D Offline
      D Offline
      Dan Neely
      wrote on last edited by
      #2

      No. The nondeterministic garbage collector makes any RT usage impossible.

      E 1 Reply Last reply
      0
      • D Dan Neely

        No. The nondeterministic garbage collector makes any RT usage impossible.

        E Offline
        E Offline
        eninyo
        wrote on last edited by
        #3

        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.

        D 1 Reply Last reply
        0
        • E eninyo

          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.

          D Offline
          D Offline
          Dan Neely
          wrote on last edited by
          #4

          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.

          E 1 Reply Last reply
          0
          • D Dan Neely

            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.

            E Offline
            E Offline
            eninyo
            wrote on last edited by
            #5

            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...

            D 1 Reply Last reply
            0
            • E eninyo

              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

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              Please don't cross post.

              --- b { font-weight: normal; }

              1 Reply Last reply
              0
              • E eninyo

                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...

                D Offline
                D Offline
                Dan Neely
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                • E eninyo

                  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

                  A Offline
                  A Offline
                  ajisthekingofpop
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • E eninyo

                    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

                    W Offline
                    W Offline
                    wout de zeeuw
                    wrote on last edited by
                    #9

                    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

                    E 1 Reply Last reply
                    0
                    • W wout de zeeuw

                      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

                      E Offline
                      E Offline
                      eninyo
                      wrote on last edited by
                      #10

                      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

                      D W 2 Replies Last reply
                      0
                      • E eninyo

                        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

                        D Offline
                        D Offline
                        Dan Neely
                        wrote on last edited by
                        #11

                        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.

                        1 Reply Last reply
                        0
                        • E eninyo

                          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

                          W Offline
                          W Offline
                          wout de zeeuw
                          wrote on last edited by
                          #12

                          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

                          E 1 Reply Last reply
                          0
                          • W wout de zeeuw

                            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

                            E Offline
                            E Offline
                            eninyo
                            wrote on last edited by
                            #13

                            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...

                            1 Reply Last reply
                            0
                            • E eninyo

                              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

                              D Offline
                              D Offline
                              Dan McCormick
                              wrote on last edited by
                              #14

                              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!

                              1 Reply Last reply
                              0
                              • E eninyo

                                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

                                B Offline
                                B Offline
                                Brian R
                                wrote on last edited by
                                #15

                                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.

                                E 1 Reply Last reply
                                0
                                • B Brian R

                                  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.

                                  E Offline
                                  E Offline
                                  eninyo
                                  wrote on last edited by
                                  #16

                                  tnx for your reply after so long time :-) unfortunatly, i didn't find solution for the GC invoking unexpectedly. i guess the C# lang' is for simple or not RT applicatons. tnx again, Eli

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups