Changeset 514d561 in mainline for uspace/lib/c/include/async.h


Ignore:
Timestamp:
2018-07-20T16:27:20Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
05208d9
Parents:
7137f74c
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-19 21:52:47)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-20 16:27:20)
Message:

Fibril/async implementation overhaul.

This commit marks the move towards treating the fibril library as a mere
implementation of a generic threading interface. Understood as a layer that
wraps the kernel threads, we not only have to wrap threading itself, but also
every syscall that blocks the kernel thread (by blocking, we mean thread not
doing useful work until an external event happens — e.g. locking a kernel
mutex or thread sleep is understood as blocking, but an as_area_create() is not,
despite potentially taking a long time to complete).

Consequently, we implement fibril_ipc_wait() as a fibril-native wrapper for
kernel's ipc_wait(), and also implement timer functionality like timeouts
as part of the fibril library. This removes the interdependency between fibril
implementation and the async framework — in theory, the fibril API could be
reimplemented as a simple 1:1 shim, and the async framework would continue
working normally (note that the current implementation of loader complicates
this).

To better isolate the fibril internals from the implementation of high-level
synchronization, a fibril_event_t is added. This object conceptually acts
like a single slot wait queue. All other synchronization is implemented in
terms of this primitive.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/async.h

    r7137f74c r514d561  
    143143extern errno_t async_wait_timeout(aid_t, errno_t *, suseconds_t);
    144144extern void async_forget(aid_t);
    145 
    146 extern void async_create_manager(void);
    147 extern void async_destroy_manager(void);
    148145
    149146extern void async_set_client_data_constructor(async_client_data_ctor_t);
     
    345342
    346343extern errno_t async_hangup(async_sess_t *);
    347 extern void async_poke(void);
    348344
    349345extern async_exch_t *async_exchange_begin(async_sess_t *);
     
    475471
    476472errno_t async_spawn_notification_handler(void);
     473fid_t async_create_manager(void);
    477474
    478475#endif
Note: See TracChangeset for help on using the changeset viewer.