Changeset d3a1ade3 in mainline
- Timestamp:
- 2010-12-26T17:25:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d1c041a
- Parents:
- d3cce52
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async_sess.c
rd3cce52 rd3a1ade3 37 37 * 38 38 * 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 transactionconsists of one or more requests (IPC calls) which can39 * server over which the client can perform multiple concurrent exchanges. 40 * Each exchange consists of one or more requests (IPC calls) which can 41 41 * be potentially blocking. 42 42 * 43 43 * Clients and servers are naturally connected using IPC phones, thus an IPC 44 44 * phone represents a session between a client and a server. In one 45 * session, there can be many outstanding transactions. In the current46 * implementation each concurrent transactiontakes place over a different47 * connection (there can be at most one active transactionper 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). 48 48 * 49 49 * Sessions make it useful for a client or client API to support concurrent … … 55 55 * There are several possible implementations of sessions. This implementation 56 56 * 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 to57 * 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 60 60 * use the existing async framework APIs 61 61 * - the server supports sessions by the virtue of spawning a new connection 62 62 * fibril, just as it does for every new connection even without sessions 63 63 * - the implementation is pretty straightforward; a very naive implementation 64 * would be to make each transactionusing a fresh phone (that is what we64 * would be to make each exchage using a fresh phone (that is what we 65 65 * have done in the past); a slightly better approach would be to cache 66 * connections so that they can be reused by a later transactionwithin66 * connections so that they can be reused by a later exchange within 67 67 * the same session (that is what this implementation does) 68 68 * 69 69 * The main disadvantages of using phones to represent sessions are: 70 70 * 71 * - if there are too many transactions (even cached ones), the task may hit its71 * - if there are too many exchanges (even cached ones), the task may hit its 72 72 * limit on the maximum number of connected phones, which could prevent the 73 73 * task from making new IPC connections to other tasks 74 74 * - if there are too many IPC connections already, it may be impossible to 75 * create a transactionby connecting a new phone thanks to the task's limit on75 * create an exchange by connecting a new phone thanks to the task's limit on 76 76 * the maximum number of connected phones 77 77 * … … 157 157 } 158 158 159 /** Start new transactionin a session.159 /** Start new exchange in a session. 160 160 * 161 161 * @param sess_phone Session. 162 * @return Phone representing the new transactionor a negative error162 * @return Phone representing the new exchange or a negative error 163 163 * code. 164 164 */ 165 int async_ transaction_begin(async_sess_t *sess)165 int async_exchange_begin(async_sess_t *sess) 166 166 { 167 167 conn_node_t *conn; … … 219 219 } 220 220 221 /** Finish a transaction.221 /** Finish an exchange. 222 222 * 223 223 * @param sess Session. 224 * @param data_phone Phone representing the transactionwithin 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 */ 226 void async_exchange_end(async_sess_t *sess, int data_phone) 227 227 { 228 228 conn_node_t *conn; -
uspace/lib/c/include/async_sess.h
rd3cce52 rd3a1ade3 46 46 extern void async_session_create(async_sess_t *, int); 47 47 extern 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);48 extern int async_exchange_begin(async_sess_t *); 49 extern void async_exchange_end(async_sess_t *, int); 50 50 51 51 #endif -
uspace/srv/vfs/vfs_register.c
rd3cce52 rd3a1ade3 274 274 if (fs->fs_handle == handle) { 275 275 fibril_mutex_unlock(&fs_head_lock); 276 phone = async_ transaction_begin(&fs->session);276 phone = async_exchange_begin(&fs->session); 277 277 278 278 assert(phone > 0); … … 298 298 if (fs->fs_handle == handle) { 299 299 fibril_mutex_unlock(&fs_head_lock); 300 async_ transaction_end(&fs->session, phone);300 async_exchange_end(&fs->session, phone); 301 301 return; 302 302 }
Note:
See TracChangeset
for help on using the changeset viewer.