|
Packaged Services |
Top Previous Next |
|
Faster Standard I/O
At any time, a task on the root can make a single function call that switch the host link away from the host comport to the HSC. From then on, all host references use the HSC. In particular, all the standard library calls (fopen, fread, fwrite,…) continue to work as before, but at a potentially greater rate. Once the HSC has been selected in this way it not be possible to switch back to the host comport and you not be able to use the HSC for any other purpose. This service requires the Diamond server to be running on the host.
For example:
// Examples\General\FhostIO.C #include <stdio.h> #include <SMT_FHIO.h>
main() { int n; char *where = "comport"; for (n=0; n<200; n++) { printf("This goes across the %s: %d\n", where, n); if (n==99) { int e = select_fast_host_io(); if (e==0) { where = "HSC"; } else { printf("Cannot switch to HSC. Error=%d\n", e); } } } }
File Transfers
There is an HscFile library, available from Sundance, that implements file transfers across the HSC. Its functionality is similar to fread and fwrite, but is sacrifices the flexibility of those functions to gain increased performance.
Performance
Although the HSC can transfer data quickly, there is a considerable overhead in setting up and starting each individual transfer. This is not significant when you are moving large volumes of data, but can dominate the time taken to handle small transfers.
| |||||