Changeset d3a1ade3 in mainline


Ignore:
Timestamp:
2010-12-26T17:25:57Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d1c041a
Parents:
d3cce52
Message:

'Exchange' is better than 'transaction', because it does not evoke ACID semantics (which we don't have).

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async_sess.c

    rd3cce52 rd3a1ade3  
    3737 *
    3838 * By the term 'session', we mean a logical data path between a client and a
    39  * server over which the client can perform multiple concurrent transactions.
    40  * Each transaction consists of one or more requests (IPC calls) which can
     39 * server over which the client can perform multiple concurrent exchanges.
     40 * Each exchange consists of one or more requests (IPC calls) which can
    4141 * be potentially blocking.
    4242 *
    4343 * Clients and servers are naturally connected using IPC phones, thus an IPC
    4444 * phone represents a session between a client and a server. In one
    45  * session, there can be many outstanding transactions. In the current
    46  * implementation each concurrent transaction takes place over a different
    47  * connection (there can be at most one active transaction per connection).
     45 * session, there can be many outstanding exchanges. In the current
     46 * implementation each concurrent exchanges takes place over a different
     47 * connection (there can be at most one active exchage per connection).
    4848 *
    4949 * Sessions make it useful for a client or client API to support concurrent
     
    5555 * There are several possible implementations of sessions. This implementation
    5656 * uses additional phones to represent sessions. Using phones both for the
    57  * session and also for its transactions/connections has several advantages:
    58  *
    59  * - to make a series of transactions over a session, the client can continue to
     57 * session and also for its exchages/connections has several advantages:
     58 *
     59 * - to make a series of exchanges over a session, the client can continue to
    6060 *   use the existing async framework APIs
    6161 * - the server supports sessions by the virtue of spawning a new connection
    6262 *   fibril, just as it does for every new connection even without sessions
    6363 * - the implementation is pretty straightforward; a very naive implementation
    64  *   would be to make each transaction using a fresh phone (that is what we
     64 *   would be to make each exchage using a fresh phone (that is what we
    6565 *   have done in the past); a slightly better approach would be to cache
    66  *   connections so that they can be reused by a later transaction within
     66 *   connections so that they can be reused by a later exchange within
    6767 *   the same session (that is what this implementation does)
    6868 *
    6969 * The main disadvantages of using phones to represent sessions are:
    7070 *
    71  * - if there are too many transactions (even cached ones), the task may hit its
     71 * - if there are too many exchanges (even cached ones), the task may hit its
    7272 *   limit on the maximum number of connected phones, which could prevent the
    7373 *   task from making new IPC connections to other tasks
    7474 * - if there are too many IPC connections already, it may be impossible to
    75  *   create a transaction by connecting a new phone thanks to the task's limit on
     75 *   create an exchange by connecting a new phone thanks to the task's limit on
    7676 *   the maximum number of connected phones
    7777 *
     
    157157}
    158158
    159 /** Start new transaction in a session.
     159/** Start new exchange in a session.
    160160 *
    161161 * @param sess_phone    Session.
    162  * @return              Phone representing the new transaction or a negative error
     162 * @return              Phone representing the new exchange or a negative error
    163163 *                      code.
    164164 */
    165 int async_transaction_begin(async_sess_t *sess)
     165int async_exchange_begin(async_sess_t *sess)
    166166{
    167167        conn_node_t *conn;
     
    219219}
    220220
    221 /** Finish a transaction.
     221/** Finish an exchange.
    222222 *
    223223 * @param sess          Session.
    224  * @param data_phone    Phone representing the transaction within the session.
    225  */
    226 void async_transaction_end(async_sess_t *sess, int data_phone)
     224 * @param data_phone    Phone representing the exchange within the session.
     225 */
     226void async_exchange_end(async_sess_t *sess, int data_phone)
    227227{
    228228        conn_node_t *conn;
  • uspace/lib/c/include/async_sess.h

    rd3cce52 rd3a1ade3  
    4646extern void async_session_create(async_sess_t *, int);
    4747extern void async_session_destroy(async_sess_t *);
    48 extern int async_transaction_begin(async_sess_t *);
    49 extern void async_transaction_end(async_sess_t *, int);
     48extern int async_exchange_begin(async_sess_t *);
     49extern void async_exchange_end(async_sess_t *, int);
    5050
    5151#endif
  • uspace/srv/vfs/vfs_register.c

    rd3cce52 rd3a1ade3  
    274274                if (fs->fs_handle == handle) {
    275275                        fibril_mutex_unlock(&fs_head_lock);
    276                         phone = async_transaction_begin(&fs->session);
     276                        phone = async_exchange_begin(&fs->session);
    277277
    278278                        assert(phone > 0);
     
    298298                if (fs->fs_handle == handle) {
    299299                        fibril_mutex_unlock(&fs_head_lock);
    300                         async_transaction_end(&fs->session, phone);
     300                        async_exchange_end(&fs->session, phone);
    301301                        return;
    302302                }
Note: See TracChangeset for help on using the changeset viewer.