I want to send some requests to timer.device, but more than one at once. The usual way on OS 3.x is to allocate one request with CreateIORequest(), open a device with it, then, if more than one request is needed, make clones with just AllocMem() and CopyMem().
When I'm looking into "AmigaOS 4 migration guide", I can see that CreateMsgPort() and CreateIORequest() are replaced with AllocSysObject[Tags](). Does it mean the former functions do not work? As I compile for MorphOS and AmigaOS 3 from the same source, I want to reduce conditional compiling as much as possible.
Then request cloning. The example in the migration guide uses one request. How should I make clones? If in traditional way, what flags for AllocMem() (I guess MEMF_SHARED, but not sure)?
I wait for requests to be completed in a big loop, which checks multiple ports. Then I can't use WaitIO() but use Wait() and then check signal mask. The result is that request stays in the port queue. Can I remove it with GetMsg() just like an ordinary message?
When I'm looking into "AmigaOS 4 migration guide", I can see that CreateMsgPort() and CreateIORequest() are replaced with AllocSysObject[Tags](). Does it mean the former functions do not work? As I compile for MorphOS and AmigaOS 3 from the same source, I want to reduce conditional compiling as much as possible.
Of course they still work. They are just implemented as wrappers for the new extended functions much like f.e. OldOpenLibrary() in classic AmigaOS is implemented simply as a call to OpenLibrary(libname, 0).
Other similar cases are f.e. OpenWindow()/OpenWindowTagList(), OpenScreen()/OpenScreenTagList() and CreateProc()/CreateNewProc().
Any structures that need to be accessed by more than one program (like IORequests f.e.) should be allocated as MEMF_SHARED.