Changeset cc27c8c5 in mainline
- Timestamp:
- 2009-06-08T18:13:00Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bac82eeb
- Parents:
- d9c8c81
- Location:
- uspace/lib/libc/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/async.c
rd9c8c81 rcc27c8c5 551 551 /* Answer all remaining messages with EHANGUP */ 552 552 while (!list_empty(&FIBRIL_connection->msg_queue)) { 553 msg_t *msg 554 = list_get_instance(FIBRIL_connection->msg_queue.next, msg_t, link); 555 553 msg_t *msg; 554 555 msg = list_get_instance(FIBRIL_connection->msg_queue.next, 556 msg_t, link); 556 557 list_remove(&msg->link); 557 558 ipc_answer_0(msg->callid, EHANGUP); … … 718 719 suseconds_t timeout; 719 720 if (!list_empty(&timeout_list)) { 720 awaiter_t *waiter 721 = list_get_instance(timeout_list.next,awaiter_t, link);721 awaiter_t *waiter = list_get_instance(timeout_list.next, 722 awaiter_t, link); 722 723 723 724 struct timeval tv; … … 736 737 737 738 ipc_call_t call; 738 ipc_callid_t callid 739 = ipc_wait_cycle(&call, timeout,SYNCH_FLAGS_NONE);739 ipc_callid_t callid = ipc_wait_cycle(&call, timeout, 740 SYNCH_FLAGS_NONE); 740 741 741 742 if (!callid) { -
uspace/lib/libc/generic/fibril.c
rd9c8c81 rcc27c8c5 50 50 #endif 51 51 52 /** This futex serializes access to ready_list, serialized_list and manage_list. 52 /** 53 * This futex serializes access to ready_list, serialized_list and manager_list. 53 54 */ 54 55 static atomic_t fibril_futex = FUTEX_INITIALIZER; … … 60 61 static void fibril_main(void); 61 62 62 /** Number of fibrils that are in async_serialized mode */ 63 static int serialized_fibrils; /* Protected by async_futex */ 64 /** Thread-local count of serialization. If >0, we must not preempt */ 63 /** Number of threads that are executing a manager fibril. */ 64 static int threads_in_manager; 65 /** Number of threads that are executing a manager fibril and are serialized. */ 66 static int serialized_threads; /* Protected by async_futex */ 67 /** Thread-local count of serialization. If > 0, we must not preempt */ 65 68 static __thread int serialization_count; 66 /** Counter for fibrils residing in async_manager */67 static int fibrils_in_manager;68 69 69 70 /** Setup fibril information into TCB structure */ … … 144 145 goto ret_0; 145 146 /* 146 * Do not preempt if there is not sufficient count of fibril147 * managers.147 * Do not preempt if there is not enough threads to run the 148 * ready fibrils, which are not serialized. 148 149 */ 149 150 if (list_empty(&serialized_list) && 150 fibrils_in_manager <= serialized_fibrils) {151 threads_in_manager <= serialized_threads) { 151 152 goto ret_0; 152 153 } … … 195 196 else if (stype == FIBRIL_FROM_MANAGER) { 196 197 list_append(&srcf->link, &manager_list); 197 fibrils_in_manager--;198 threads_in_manager--; 198 199 } else { 199 200 /* … … 209 210 dstf = list_get_instance(manager_list.next, fibril_t, link); 210 211 if (serialization_count && stype == FIBRIL_TO_MANAGER) { 211 serialized_ fibrils++;212 serialized_threads++; 212 213 srcf->flags |= FIBRIL_SERIALIZED; 213 214 } 214 fibrils_in_manager++;215 threads_in_manager++; 215 216 216 217 if (stype == FIBRIL_FROM_DEAD) … … 220 221 dstf = list_get_instance(serialized_list.next, fibril_t, 221 222 link); 222 serialized_ fibrils--;223 serialized_threads--; 223 224 } else { 224 225 dstf = list_get_instance(ready_list.next, fibril_t, … … 270 271 /** Add a fibril to the ready list. 271 272 * 272 * @param fid P inter to the fibril structure of the fibril to be273 * @param fid Pointer to the fibril structure of the fibril to be 273 274 * added. 274 275 */ … … 288 289 /** Add a fibril to the manager list. 289 290 * 290 * @param fid Pinter to the fibril structure of the fibril to be added. 291 * @param fid Pointer to the fibril structure of the fibril to be 292 * added. 291 293 */ 292 294 void fibril_add_manager(fid_t fid) … … 315 317 /** Return fibril id of the currently running fibril. 316 318 * 317 * @return Fibril ID of the currently running pseudo thread.319 * @return Fibril ID of the currently running fibril. 318 320 */ 319 321 fid_t fibril_get_id(void)
Note:
See TracChangeset
for help on using the changeset viewer.