Re: Asynchronous Data Transfer to a PCI Device
Who queued the Param blocks before? The user client async methods are usually not what you want! Asynchronous I/O 101. There seems to be a lot of confusion about what an asynchronous I/O operation is. So lets go back to 1st principals. An Asynchronous operation is one that can proceed without explicit CPU intervention. This frees the CPU to return to the 'main loop'. Then at some stage in the future the operation completes and causes some client code to execute. So to initiate an asyncrhonous operation you make a subroutine call to a driver somewhere. This call is 'synchronous', isn't it, by that I mean you expect the routine to return don't you? So use Xs synchronous routines to initiate an asynchronous I/O operation. Your email doesn't make clear, are you really POLLING on 'ioResult'. How often do you poll per second, can you measure this in your code please? This is very bad behaviour on X. On X we recommend the use of the Notification port API. First create a port with IONotificationPortCreate. Then register it with your driver using IOConnectSetNotificationPort(), this call calls IOUserClient::registerNotificationPort inside your driver. This sets the plumbing up from the kernel's point of view. Finally you need to plumb the completion call back into your 'mainloop'. This is pretty easy. Call IONotificationPortGetRunloopSource() then register the this source with your applications runloop. This is the general outline of your solution. We can go on from here as you get comfortable with this. Godfrey van der Linden an IOKit architect _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Godfrey van der Linden