Use CScheduler for wallet flushing, remove ThreadFlushWalletDB #9605
pull TheBlueMatt wants to merge 3 commits into bitcoin:master from TheBlueMatt:2017-01-cscheduler-cleanups changing 8 files +42 −46-
TheBlueMatt commented at 9:04 pm on January 20, 2017: memberAlso uses std::function instead of boost::function.
-
fanquake added the label Refactoring on Jan 20, 2017
-
in src/scheduler.h: in 5d0d061480 outdated
21@@ -23,7 +22,7 @@ 22 // 23 // CScheduler* s = new CScheduler(); 24 // s->scheduleFromNow(doSomething, 11); // Assuming a: void doSomething() { } 25-// s->scheduleFromNow(boost::bind(Class::func, this, argument), 3); 26+// s->scheduleFromNow(std::bind(Class::func, this, argument), 3); 27 // boost::thread* t = new boost::thread(boost::bind(CScheduler::serviceQueue, s));
sipa commented at 10:56 pm on January 20, 2017:Adapt comment here as well?
TheBlueMatt commented at 11:14 pm on January 20, 2017:No, it still must run inside a boost::thread because it relies on boost::interruption_point. I believe @theuni is planning on cleaning that up.
TheBlueMatt commented at 11:31 pm on January 20, 2017:well technically boost::thread takes a boost::function, so I assume if you uses std::bind it would create a boost::function around the std::function……I’ll let cory do that when we kill boost::threads.
theuni commented at 7:08 am on January 21, 2017:Yes, I have a local branch with CScheduler converted. I’m doing them in chunks, because the last huge PR proved to be too big to review/rebase. I’ll submit that one next (#9566 is the current one).sipa commented at 11:07 pm on January 20, 2017: memberConcept ACKsipa commented at 11:24 pm on January 20, 2017: memberI mean the boost::bind here.theuni commented at 7:09 am on January 21, 2017: memberConcept ACK!. I’ve considered doing this a few times as well.in src/wallet/walletdb.cpp: in 5d0d061480 outdated
767@@ -768,67 +768,60 @@ DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet, vector<CWalletTx>& vWtx) 768 return DB_LOAD_OK; 769 } 770 771-void ThreadFlushWalletDB() 772+void MaybeFlushWalletDB()
laanwj commented at 12:27 pm on January 23, 2017:If you’re renaming this function please, finally, change it to something else than FlushWalletDB. What is being done here is not merely a flush (those are done all the time as CWalletDB instances go out of scope) but more like “database consolidation”, merging the log files into wallet.dat so that the wallet is self-contained. This has confused many people over time.
TheBlueMatt commented at 2:28 pm on January 23, 2017:Done, called it “compact”laanwj commented at 12:27 pm on January 23, 2017: memberConcept ACKlaanwj commented at 9:05 am on January 26, 2017: memberlaanwj added this to the milestone 0.15.0 on Feb 6, 2017TheBlueMatt force-pushed on Feb 8, 2017TheBlueMatt commented at 6:20 pm on February 8, 2017: memberRebased. Note that this now forms the first of a rather long patchset to move wallet callbacks into a background thread without introducing races in APIs or wallet consistency issues.theuni commented at 11:13 pm on March 6, 2017: memberutACK. Needs rebase.CScheduler boost->std::function, use millisecs for times, not secs 73296f54d6Use CScheduler for wallet flushing, remove ThreadFlushWalletDB 735d9b5362Rename FlushWalletDB -> CompactWalletDB, add function description 0235be1e7aTheBlueMatt force-pushed on Mar 6, 2017TheBlueMatt commented at 11:35 pm on March 6, 2017: memberRebased.laanwj commented at 10:01 am on March 7, 2017: memberutACK 0235be1laanwj merged this on Mar 7, 2017laanwj closed this on Mar 7, 2017
laanwj referenced this in commit 779f2f9747 on Mar 7, 2017PastaPastaPasta referenced this in commit 01fa0df568 on Dec 30, 2018PastaPastaPasta referenced this in commit 59ab029c6f on Dec 31, 2018PastaPastaPasta referenced this in commit 85de06c75d on Dec 31, 2018PastaPastaPasta referenced this in commit 559c03f0f9 on Dec 31, 2018PastaPastaPasta referenced this in commit cbd0f0c34a on Jan 2, 2019PastaPastaPasta referenced this in commit 0019f5db2a on Jan 2, 2019PastaPastaPasta referenced this in commit d746f8e3e2 on Jan 3, 2019PastaPastaPasta referenced this in commit 1f85228a25 on Jan 21, 2019PastaPastaPasta referenced this in commit d71ae5f3a6 on Jan 27, 2019PastaPastaPasta referenced this in commit ff7daf4acf on Jan 29, 2019PastaPastaPasta referenced this in commit 1a32400bf9 on Feb 5, 2019PastaPastaPasta referenced this in commit 8d249d4dff on Feb 5, 2019PastaPastaPasta referenced this in commit 89d95213a0 on Feb 5, 2019PastaPastaPasta referenced this in commit 9a3067115f on Feb 5, 2019PastaPastaPasta referenced this in commit df8fab4d33 on Feb 5, 2019furszy referenced this in commit 6143f803b2 on Jan 30, 2021MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me