Commit Graph

25 Commits

Author SHA1 Message Date
Jōshin
67c0b7b39b Clean up allocator defs
- Condense the allocator section in defs.h and make it match the
  surrounding style.

- Use real calloc in c3_calloc. Some guy on the internet says
  calloc can be faster than malloc since the OS may not actually
  need to call memset.

- Replace calloc calls in vere code with c3_calloc.

Note that I left the c3_calloc definition as-is (i.e., not taking
a count argument). I was going to change it, but it seems like
count is 1 at all call sites. If it's ever used with count != 1,
I'd be in support of changing it, fwiw.
2019-01-02 11:23:06 -08:00
Isaac Visintainer
61b9556612 fix _raft_lame bug 2018-12-17 16:59:24 -08:00
Joe Bryan
7a172f6860 renames event-timing, adds build option to enable 2018-12-13 20:03:19 -05:00
Joe Bryan
5a397fef43
Merge pull request #1107 from urbit/crypt-log
re-enable event-log encryption
2018-12-13 19:55:22 -05:00
Joe Bryan
80f723fc17
Merge pull request #1103 from urbit/work-on-lead
calls u3_raft_work on leader promotion (for eager restart effects)
2018-12-12 02:27:23 -05:00
Joe Bryan
958e857476 calls u3_raft_work on leader promotion (for eager restart effects) 2018-12-12 02:24:13 -05:00
Joe Bryan
62960bbc28 enables event-log encryption 2018-12-12 01:19:34 -05:00
Joe Bryan
dfecb3a1cb refactors event poke, removing unnecessary effect traversal 2018-12-12 00:39:06 -05:00
Joe Bryan
d448340a76 adds and corrects some raft comments 2018-12-11 20:55:52 -05:00
Joe Bryan
302704bd22 separates effects and persistence
and always apply effects, even if the state didn't change
2018-12-11 20:51:09 -05:00
Ted Blackman
d8b7068345 updates u3_raft_work() to be async, adds sync u3_raft_play() 2018-12-11 17:13:55 -05:00
Ted Blackman
6e77f2b2c1 synchronously processes each event singly 2018-12-11 16:39:54 -05:00
Joe Bryan
97408e42f4 handles effect/event pairs singly while iterating queue 2018-12-11 16:39:07 -05:00
Ted Blackman
0a66673134 factor out raft_pump() 2018-12-11 02:09:52 -05:00
Ted Blackman
94cacc5629 factored out _raft_crop() and _raft_poke() 2018-12-11 02:08:49 -05:00
Ted Blackman
43d18fd0a3 uncouple roe mutation 2018-12-11 02:08:00 -05:00
Ted Blackman
cf935baf0f Synchronous egg commitment 2018-12-11 02:04:16 -05:00
Elliot Glaysher
8b9680072a Add support for trace_event files.
This adds a -j parameter which writes traces of your Urbit's function call
stack to a json file, readable by Chrome's about://tracing or the standalone
trace-viewer webapp.
2018-12-01 15:54:55 -08:00
Joe Bryan
9121e108ab removes %behn timer backoff 2018-11-26 12:22:13 -05:00
Paul Driver
a61ed7df17 fix compile errors 2018-03-30 11:49:18 -07:00
C. Guy Yarvin
9253613738 Let's not encrypt (because encryption is now in zuse). 2017-09-27 17:28:11 -07:00
C. Guy Yarvin
497b1ffb7f Fix crash when error delivery fails. 2017-07-27 15:27:53 -07:00
C. Guy Yarvin
35a385e81c Fully shifted over to modern typed namespace. 2016-02-03 20:51:01 -08:00
Dan Haffey
2acf161381 Cursor spinner while processing events for more than 500ms. (#599)
The spinner is a simple |/-\ at the current cursor position. For non-terminal
events, the root of the event's wire is also displayed to the right of the
spinner to give some indication of what's causing an unresponsive terminal.

I used the simplest synchronization strategy I could think of: u3_utat.mex_u is
a mutex that serializes access to a terminal's state. The main thread holds it
at all times except when processing events. When a terminal receives a %bee blit
with a non-nul bulb (the event ovum), it releases the mutex to let the spinner
thread do its thing. A %bee with a nul bulb halts the spinner by grabbing the
mutex and refreshing the input line.

Off-thread console writes are directly against the underlying fd to avoid
trashing non-thread-safe libuv state. Given the simple locking pattern, calling
libuv from the spinner thread might be fine, but I didn't feel like auditing
vere to rule out concurrent calls. It worked when I tried it, but... threads.

I didn't look into supporting anything other than the main terminal, so
currently it's the only one that receives %bee blits. In daemon mode, the
spinner is disabled entirely and no additional thread is started.
2015-12-12 20:42:33 -08:00
Philip C Monk
9edda1bb73 descriptive names for c files
fixes #294
2015-06-23 21:29:11 -04:00