Rene W. Olsen wrote:
I dont like the "server process" method...
when moving lots of data that method will be really slow
becorse it has to enter wait state so offen.
The problem is, like I said, that a device must be opened by the same
task that is going to use it. A server process might not be a nice
solution, but it *is* a solution to this problem.
It need not be slow either. You don't need to copy data. This will
really only pose a problem if there is a lot of small data items being
moved around.
I have looked at clone interface, this really looks
promessing especially if I can use one of the
reserved fields in InterfaceData struct as a userdata field..
No, you shouldn't use these. Use a data size. For example, something
like this:
struct Foo
{
uint32 field1;
void *field2;
char field3[20];
float field4;
};
During creation of the interface, pass
MIT_Flags, IFLF_PRIVATE,
MIT_DataSize, sizeof(struct Foo),
In your method, use
struct Foo *instanceData = (struct Foo *)((uint8 *)Self
-sizeof(struct Foo));
to obtain the private instance data of your interface (looking at this I
guess we should add a macro for that to the header file ;-)
Best regards,
--
Hans-Joerg Frieden
Technical Director, AmigaOS 4.0 Project
Hyperion Entertainment
Email: Hans-JoergF(a)hyperion-entertainment.com
Web:
http://www.hyperion-entertainment.biz/