Re: Mathlink performance and task switches
- To: mathgroup at smc.vnet.net
- Subject: [mg42162] Re: Mathlink performance and task switches
- From: Bruno Daniel <bruno.daniel at hadiko.de>
- Date: Sat, 21 Jun 2003 02:49:38 -0400 (EDT)
- Organization: University of Karlsruhe, Germany
- References: <bbq85s$d4v$1@smc.vnet.net> <bc46dc$ksh$1@smc.vnet.net> <bc6nam$2g7$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Dear colleagues > > a) short C/C++ functions are not faster than in Mathematica because > > Mathematica is so lighting fast > > b) the overhead of the protocol, i.e., convert the data, place it in > > a shared memory area, read it from a shared memory area, check the > > arguments, > > write the result to a shared memory area read it back to the kernel, > > will cause > > the delay, not the task switch Unfortunately, this is not true. The overhead of the protocol (except in case of copying large arrays) is negligible to the additional and unnecessary overhead of waiting for a task switch (in fact 2, because the result is passed back in another task switch) to occur and handling it. As I already stated, this involves milliseconds regardless of the speed of the computer. Concerning SGI, Linux and other systems, the problem is the same, because it is inherent in all multitasking systems (without real-time behaviour), and a solution should be similar for these systems as for Windows. Imagine the power of Mathematica if it could be efficiently linked to all kinds of libraries (think of the NAG library, system libraries, Common Lisp Object System, Prolog, specialized computer algebra systems) without restrictions on the size of the functions called and the frequency of calls back and forth. One could combine the nice declarative programming style of Mathematica and its mathematical capabilities with legacy code and other programming paradigms. Wouldn't that be great? Best regards Bruno Daniel