Fernando, try this branch:<br><br><a href="https://github.com/takluyver/ipython/tree/history-threaded">https://github.com/takluyver/ipython/tree/history-threaded</a><br><br>There are some issues in the tests (I guess it's race conditions with history access). I must say, I don't much like this approach. Apart from the race conditions, we need a separate connection to the database for the thread, which then has to passed as an argument to every function called from that thread... I'm sure it can be done, but it's a significant extra source of potential problems. Indeed, one of the motivations for my history refactor was to remove the need for a thread to save history...<br>

<br>How slow is the system on which you're seeing noticeable delays? If we changed the defaults so that we're saving on every 5th or 10th command, rather than after every command, would the delay be acceptable?<br>

<br>Thomas<br>