ThrottleStream robustness

 * Document (and explicitly implement) that either 0 or ~0u indicates
   no throttle
 * Never sleep for longer than a tenth of a second
 * Document that because of the above, practical lower bound is 800bps
   (1 byte every tenth of a second)

Change-Id: I2a432b3021f40a0799b90ca3cbd3e5e77ccd5b34
Reviewed-on: https://gerrit.dechocorp.com/8528
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Reviewed-by: Russ Simons <russs@mozy.com>
Drop fiberBacktrace for use from debugger

Just use ".cxr <Fiber::m_sp + 0x14*>" from the immediate window, and enjoy the
full debugging experience.

* 0x30 for x64

Change-Id: I7858be1aa872aa504f557abdb83ea8d318e73970
Reviewed-on: https://gerrit.dechocorp.com/8539
Reviewed-by: Cody Cutrer <cody@mozy.com>
add test framework to xcode

Change-Id: I8080933b88f6b47ac475a60e47e3f8a1fad402b9
Reviewed-on: https://gerrit.dechocorp.com/8680
Reviewed-by: Cody Cutrer <cody@mozy.com>
Reviewed-by: BJ Homer <bjh@decho.com>
Macro for main (so you get UTF-8 on Windows)

Change-Id: Id135c6460cb163b5bc659f3f01196c62ddeb353f
Reviewed-on: https://gerrit.dechocorp.com/8809
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Daemon functions

Read comment in daemon.h for details

Change-Id: Id3706db73a5a20ed769ce7edd3af2c75fcabea06
Reviewed-on: https://gerrit.dechocorp.com/8830
Reviewed-by: JT <jt@mozy.com>
Reviewed-by: tom <tom@mozy.com>
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Log the correct value

Change-Id: Ic6f45434fc73ec4a783dbec4877ccf60f674ec9c
Reviewed-on: https://gerrit.dechocorp.com/8849
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Logging for files and related.

FileStream, HandleStream, FDStream, and NamedPipeStream.

Change-Id: I7fe79a6a52ec90f0abe8968a5d6a1cf20ddb5c26
Reviewed-on: https://gerrit.dechocorp.com/8695
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Syslog logging

Change-Id: I05c23d3c0148caca99e77991dca13d35fc361d87
Reviewed-on: https://gerrit.dechocorp.com/8850
Reviewed-by: JT <jt@mozy.com>
Function for getting the list of addreses on a system.

Change-Id: Ida2f366f414501c237e918a94821fb7ea455290f
Reviewed-on: https://gerrit.dechocorp.com/8949
Reviewed-by: Cody Cutrer <cody@mozy.com>
IOStream manipulators for telling IPAddress if you want the port or not

Change-Id: Ib59e36ae76d588416324997b8fd66a579f686b60
Reviewed-on: https://gerrit.dechocorp.com/9031
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
The space was bugging me

Change-Id: I26b730a5ba569430ccf3913d51d1bde06e186c08
Reviewed-on: https://gerrit.dechocorp.com/9033
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Release the delegate from a schedule() call ASAP

Change-Id: Ib7e0f176250ba713a8e142aa070e57b9b518a3c9
Reviewed-on: https://gerrit.dechocorp.com/8990
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Overhaul ConfigVar notifications

 * Use boost::signals2 instead of a plain boost::function
 * Change fromString() val(const T &) to return bool if the change was
   successful
 * Catch boost::bad_lexical_cast, and return false
 * Add a beforeChange event that takes the proposed value and can return
   false to prevent the change from happening
 * Add a typed onChange event that takes the new value to be used to prevent
   race conditions between changing the value and reading it (ConfigVars
   technically still aren't thread safe)

Also, remove "dynamic" and "automatic" flags on ConfigVars... they weren't
used, and you should just prevent the variable from being changed instead of
marking it as non-dynamic.

Change-Id: I1e460eaf7444b23c473bc42c644347298eac9c7d
Reviewed-on: https://gerrit.dechocorp.com/9032
Reviewed-by: BJ Homer <bjh@decho.com>
Fix for gcc
s/IOManager(IOCP|EPoll|KQueue)/IOManager/

So that IOManager can be forward declared.  Fix up several things that
depended on full inclusion of iomanager.h, or it being transitively included.

Change-Id: Ic5b75797d3f62565395ff236cc42ca9f2e2d9924
Reviewed-on: https://gerrit.dechocorp.com/9073
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Don't include assert.h or buffer.h in stream.h

... and consequences.

Change-Id: I5c5914555ef25722bd4ea04b1890d83893efae1d
Reviewed-on: https://gerrit.dechocorp.com/9074
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Split scheduler.cpp/.h in four

 * scheduler.h is just scheduler (no longer includes fiber.h)
 * parallel.h for parallel_do and parallel_foreach
 * fibersynchronization.h for FiberMutex et al (does not include fiber.h)
 * workerpool.h for WorkerPool

... and deal with the consequences

Change-Id: I7a35dc3ddc332467b6f83e4f4efef1ea93a2dedf
Reviewed-on: https://gerrit.dechocorp.com/9075
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Make sure multi-threaded schedulers don't have threads lay idle.

Change-Id: Ie6de4b3808290475b99cb263ccafafbf4e1459c5
Reviewed-on: https://gerrit.dechocorp.com/9087
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Avoid tickle storms, and fix stopping multithreaded schedulers.

There's the possibility that when stop is called and there is still work to be
done, the "stop" tickle will get lost.  So compensate by re-tickling for each
thread that does actually stop (i.e. the thread that completes the last piece
of work will tickle other threads that were waiting for work).

Change-Id: I71578e03f0f7ce871844a70d0fd2ada1f38b70d8
Reviewed-on: https://gerrit.dechocorp.com/9090
Reviewed-by: Jeremy Stanley <jeremys@decho.com>
Use EPOLLET.

 a) It's more performant
 b) We're using it in edge triggered fashion anyways
 c) I don't trust level-triggered for multi-threading

Change-Id: Ibe6bdf6c81b42d6104006255e75ad7b9c6b2d613
Reviewed-on: https://gerrit.dechocorp.com/9093
Reviewed-by: Cody Cutrer <cody@mozy.com>