Agreed - it's not a simple problem. But, as I say, the first step, which might be useful in its own right, would be to build libraries for these functions which work on System 6(?) and newer. It's not going to be quick - so for low latency activities these libraries might not be hugely useful...