Announcement

Collapse
No announcement yet.

math co-processor questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • math co-processor questions

    I'm building a web app using mysql, and I want to integrate some fairly complicated indexing, and I was thinking that maybe it was possible to use the math co-processor to run along side, reading data and sorting/compressing it while the main processor does it's usual thing.

    possible?, any ideas?

  • #2
    hmmm, from; http://en.wikipedia.org/wiki/Coprocessor


    Overview

    A coprocessor may not be a general-purpose processor in its own right. Some coprocessors cannot fetch instructions from memory, execute program flow control instructions, do input/output operations, manage memory, and so on. These processors require the host main processor to fetch the coprocessor instructions and handle all other operations aside from the coprocessor functions. In some architectures the coprocessor is a more general-purpose computer, but carries out only a limited range of functions under the close control of a supervisory processor. Note the difference to the term multiprocessor, which refers to a computer with more than one general-purpose CPU.

    Comment


    • #3
      Well, multi-threading comes to mind, as long as you are not already CPU-Bound.

      Or, you can purchase a computer with multple CPUs, except that requires you write your code multi-threaded to get the benefit anyway.

      Or, you can do multi-process stuff (CreateProcess, ShellExecute[ex], SHELL). Another process = (ta da!) another thread!

      All in all, I think you should just start with multi-threading.


      MCM
      Last edited by Michael Mattias; 21 Mar 2009, 10:05 AM.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        hi Michael, yeah a little research sends me the same place, threads or using a second server, thanks

        Comment


        • #5
          Originally posted by Brad D Byrne View Post
          I'm building a web app using mysql, and I want to integrate some fairly complicated indexing, and I was thinking that maybe it was possible to use the math co-processor to run along side, reading data and sorting/compressing it while the main processor does it's usual thing.

          possible?, any ideas?

          If matrix or vector operations, one possibility is to use the graphics GPU to perform the calculations.

          Comment


          • #6
            to run along side, reading data and sorting/compressing it while the main processor does it's usual thing.....
            ....yeah a little research sends me the same place, threads

            This is exactly why multi-threading capability exists... to allow your program to "do something" in the background whilst the main body of your program "does its usual thing." Exactly. Spot-on. Bingo.

            With all the 'force fit' attempts we see here - trying to 'game the system' or use a hacksaw when the right tool is a hammer - I would have thought "let's use one or more additional threads of execution" for this application would have reached out and whopped you upside the head....especially since your own description of the challenge (above) may as well have been written by the person in charge of creating the 'mission statement' for support for additional threads of execution.

            That said, it's not all that easy to manage your data in a multi-threaded environment, and when you DO reach the point where these operations have to be synchronized, you'll have to reach for those scary-looking "WaitForxxxxx" functions.

            But A) all that stuff 'works as advertised' and B) there's lots of 'starter code' in the Source Code Forum.

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              If it is a single core CPU then threading might not help you much, if the main app is also CPU intensive then it might even slow the whole process down with the added overhead of thread switching. To be clear a modern single core CPU only runs one thread at a time, it cannot run a seperate thread in the floating point processor (modern CPU's haven't used coprocessors for many years except GPU's). The main speed advantage of threads is if the main app is not full utilising the CPU ie waiting for user input etc.
              If speed is a real issue then you should be using a dual or quad core processor which can then really make use of the threads.

              Comment

              Working...
              X