forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
New fiber API
Konstantin Osipov edited this page Jul 22, 2014
·
2 revisions
We need to be able to syncrhonously wait till a fiber ends (already
possible with checking for fiber:status()
and grab the results
its main function returns.
Something like:
local v1, v2, v3 = fiber:join()
fiber:join()
returns what the function, passed to fiber:create()
has returned.
It is also necessary :
- to make it possible to call
fiber:join()
a long time after the fiber main function has ended - to make
fiber:join()
callable multiple times (it should return the same all the time). QQQ (@kostja this would leak memory) - make
fiber:join()
callable from multiple fibers, and, if called before the subject fiber has finished work, the caller is suspended until the subject fiber has ended.
Additinally:
- if the subject fiber ended with an exception,
fiber:join()
should throw the same exception -
fiber:join()
should be callable on a fiber which has no variables referencing it, but was obtained withfiber.find()
-
fiber:join()
on a system fiber should be safe (should throw an error)
Note: mailboxes seem to be obsolete with fiber local storage.
Each fiber should have a built-in fiber-ipc-channel.
This simplifies the following matters:
- Sending a mesasge to the fiber:
fiber.sendmsg{}
could be used. - Receiving a message:
fiber.recvmsg( [ timeout ] )
- An attemt to get another fiber s message should lead to an exception
- A channel should be created on demand, since many fibers will not use it.
- The size of the fiber should be configurable, set to 1 by default.
- It should be possible to change the size of the channel. If the new size is below the current amount of messages in the channel, it should throw an error.
- The channel should not go away when fiber variable goes away.
Architecture Specifications
- Server architecture
- Feature specifications
- What's in a good specification
- Functional indexes
- Space _index structure
- R tree index quick start and usage
- LuaJIT
- Vinyl
- SQL
- Testing
- Performance
How To ...?
- ... add new fuzzers
- ... build RPM or Deb package using packpack
- ... calculate memory size
- ... debug core dump of stripped tarantool
- ... debug core from different OS
- ... debug Lua state with GDB
- ... generate new bootstrap snapshot
- ... use Address Sanitizer
- ... collect a coredump
Lua modules
Useful links