|
As usual it, of course, all depends. send() and recv() are synchronous in nature. You call the APIs and your code basically waits for the send and/or receive APIs to copy your buffer of data to/from internal buffers. QsoStartSend() and QsoStartRecv() are asynchronous in nature. You call the APIs and control is returned to you almost immediately. While your code continues on its way to do other things the system is, in the background, sending or receiving data into the buffer you specified on the Qso* call. Your code should not do anything with the buffer until the background operation has completed (or terrible things might happen) but could be doing "other" processing if there is any. For some applications this ability to have the IO performed asynchronously while the application continues to process may be of little or no value. For other applications it might provide significant performance improvements. I really can't say where your application may fall in this range as the ability to productively use these features is very application specific. As you mentioned combining asynch IO APIs and sockets APIs (which I interpret as meaning send() and recv()) I will point out that the Usage Notes for the Qso* APIs recommend not using these two sets of APIs on the same socket. Bruce "Lim Hock-Chai" <Lim.Hock-Chai@ar ch.com> To Sent by: "RPG programming on the AS400 / rpg400-l-bounces@ iSeries" <rpg400-l@xxxxxxxxxxxx> midrange.com cc Subject 05/28/2004 08:48 RE: Asynchronous IO api AM Please respond to RPG programming on the AS400 / iSeries I used Scott's socket tutorial to create a client side socket program a while back. It works wonderfully. Currently, I'm researching on creating a server side socket program. Combine Async IO and Socket APIs seem to be the most efficient way for this. However, as Scott mentioned, I did notice that Async IO apis are multi threaded. That is way I post the question to make sure that it can be done in RPG before I try it. Bruce: Will I still get a lot of benefit out of it if I use Async IO with single thread? Thanks. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bruce Vining Scott, If by asynchronous IO you are refering to the Qso* socket APIs then consider yourself gently corrected :) While the Information Center examples refer to and use a multi-threaded server environment you can also use asynchronout IO from a single threaded environment and still obtain the benefits that the APIs provide. Bruce _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.