News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

math co-processor questions

Started by Brad, March 21, 2009, 12:51:53 PM

Previous topic - Next topic

Brad

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?

thanks! :)

Brad

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.

Mark Jones

This sounds correct Brad. Today's processors are leaps-and-bounds more advanced than a "co-processor," but math functions still take some CPU time. (There is no way to "offload" all of the calculation to the ALU, leaving the CPU free to do other things.)

This is not usually a problem however, because today's processors contain extensive features for handling multiple data simultaneously. (So-called SIMD instructions: MMX, 3DNow!, SSE, etc.)

Programming such a calculation routine, while accessing SQL data, is definitely possible, however would be very complex.

Another option is multi-threading the application. Newer processors contain multiple "cores," which do run mostly independent of each other. (Even a multi-processor machine shares the same busses and RAM and whatnot, so there will never be true asynchronicity.) But if one thread was busy processing the SQL, another thread could be working on the index with little slowdown. However in every multi-threading application, signalling becomes an issue because each thread must know what each other thread is doing. In short, it can get tricky, fast. :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Brad

yeah, thanks Mark, I quickly came to sanity once I started reading a bit!!  :wink