This version of camel is working towards being multi-thread safe (MT-SAFE). At least, for the important api's. This code has now been merged into the main head, but this file will remain here as a log of how it was done, incase any issues arise. The ChangeLog of course has a much more detailed list of changes. Intended method =============== I intend working on it in several stages: 1. Making the api multi-threadable. Basically removing some const-returns, and copying some data where it wasn't before. The api should still continue to work if not being used in a multithreaded application. There is not a significant amount of work here since this was more or less the intention all along. Some functions where references to objects are returned may have to be changed slightly, so that refcounts are incremented before return. This doesn't affect much though. camel_folder::get_message_info done camel_folder_summary::uid done camel_folder_summary::index done camel_folder::get_summary Needs to ref each summary item it points to. done camel_folder::free_summary Needs to unref each summary item it points to. done camel_folder_get_message_tag needs to copy the tag return camel_maildir_summary filename string should not be able to modify the string array contents after it has been added to the summary. camel_folder done Make every camel-folder use a camel-folder-summary. This just reduces some of the code duplication, since everything but vee-folder does this already. 2. Adding high level locks for proof of concept. The locks will be stored in private or global data, so the api should remain the same for non-threaded applications. A per-folder lock which governs access to the folder summary, the folder file or communications socket, etc. done Locking for exceptions. done Per store locks for internal stuff. done Per-service locks for various internal lists and caches done 3. Further fine-grained locking where it can be done/is worthwhile. A per-index lock for libibex done Locking for the search object half done Internal lock for the folder_summary itself So that searching can be detatched from other folder operations, etc. done Possibly a lock for access to parts of a mime-part or message 4. A method to cancel operations. Individual outstanding operations must be cancellable, and not just 'all current operations'. This will probably not use pthread_cancel type of cancelling. This will however, probably use a method for starting a new thread, through camel, that can then be cancelled, and/or some method of registering that a thread can be cancelled. Blocking states within camel, within that thread, will then act as checkpoints for if the operation, and if it is cancelled, the operation will abort (i.e. fail, with an appropriate exception code). Operation cancelling should also function when the application is not multi-threaded. Not sure of the api for this yet, probably a callback system. Hopefully the api for both scenarios can be made the same. Other thoughts ============== Basically much of the code in camel that does the actual work does NOT need to be thread safe to make it safely usable in an mt context. camel-folder, camel-summary, camel-imap-search, and the camel-service classes (at least) are the important ones to be made multithreaded. For other things, they are either resources that are created one-off (for example, camel-mime-message, and its associated parts, like camel-internet-address), or multithreadedness doesn't make a lot of sense - e.g. camel-stream, or camel-mime-parser. So basically the approach is a low-risk one. Adding the minimum number of locks to start with, and providing further fine-grained locks as required. The locks should not need to be particularly fine-grained in order to get reasonable results. Log of changes ============== Changed CamelFolder:get_message_info() to return a ref'd copy, requiring all get_message_info()'s to have a matching free_message_info(). Moved the CamelFolder frozen changelog data to a private structure. Added a mutex for CamelFolder frozen changelog stuff (it was just easy to do, although it isn't needed yet). Added a single mutex around all other CamelFolder functions that need it, this is just the first cut at mt'edness. Fixed all camel-folder implementations that call any other camel-folder functions to call via virtual methods, to bypass the locks. Added camel-store private data. Added a single mutex lock for camel-store's folder functions. Added camel-service private data. Added a single mutex lock for camel-service's connect stuff. Added a mutex for remote-store stream io stuff. Added a mutex for imap, so it can bracket a compound command exclusively. Pop doesn't need this since you can only have a single folder per store, and the folder interface is already forced single-threaded. Added mutex for camel-session, most operations. Running the tests finds at least 1 deadlock so far. Need to work on that. Fixed get_summary to ref/unref its items. Removed the global folder lock from the toplevel camel_folder_search(), each implementation must now handle locking. Fixed the local-folder implementation of searching. imap-folder searching should already be mt-safe through the command lock. Fixed imap summary to ref/unref too. Built some test cases, and expanded the test framework library to handle multiple threads. It works! Next, added a recursive mutex class, so that locking inside imap had any chance of working. Got imap working. Moved the camel folder summary into the base folder class, and fixed everything to use it that way. Made the vfolder use a real camel-folder-summary rather than a hashtable + array that it was using, and probably fixed some problems which caused evolution-mail not to always catch flag updates. Oh, and made it sync/expunge all its subfolders when sync/expungeing. Made the camel-folder summary completely mt-safe. Removed all of the locks on the folder functions dealing directly with the summary, so now for example all summary lookups will not be interupted by long operations. Made the nntp newsrc thing mt-safe, because of some unfortunate sideeffect of it being called from the summary interaction code in nntp-folder. mlcharent
ts-gnome/commit/x11-clocks?h=dependabot/npm_and_yarn/devel/electron6/files/ini-1.3.8&id=5d622b9f80e5e37b97fd9b4916de61d14e7190a3'>Fix a crash on sparc64 (and other 64-bit strict alignment archs).
Commit message (Expand)AuthorAgeFilesLines
* all: Remove all other $FreeBSD keywords.Mathieu Arnold2021-04-062-4/+0
* Remove # $FreeBSD$ from Makefiles.Mathieu Arnold2021-04-061-1/+0
* - Add licenseDmitry Marakasov2018-06-191-1/+7
naddy2010-08-072-0/+12
* Update to 2.34wxs2010-07-052-4/+4
* Present KDE SC 4.4.5 for FreeBSD.makc2010-06-301-3/+3
* - Update to 1.4.romain2010-06-064-92/+76
* LICENSE GPLv2dinoex2010-06-041-0/+2
* Present KDE SC 4.4.4 for FreeBSD.makc2010-06-021-3/+3
* update xfce to 4.6.2oliver2010-05-313-3/+3
* - Update to my @FreeBSD.org addressuqs2010-05-312-5/+7
* Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-315-5/+5
* - drop USE_GNUSTEP_PREFIXdinoex2010-05-302-12/+11
* - update to 0.3dinoex2010-05-242-6/+5
* Remove needless LDCONFIG_DIRS from kde@ ports.makc2010-05-231-1/+0
* Update to 2.33wxs2010-05-182-4/+4
* - The FreeBSD KDE team is pleased to announce KDE SC 4.4.3 for FreeBSDfluffy2010-05-112-4/+3
* - Update to Xorg 7.5miwi2010-05-012-5/+4
* - update to 1.4.1dinoex2010-03-2820-19/+20
* Presenting KDE 4.3.5 for FreeBSD. The official release notes for thismiwi2010-02-072-4/+3
* - update to jpeg-8dinoex2010-02-0519-18/+19
* Change MAINTAINER address to romain@.romain2010-02-021-1/+1
* Drop USE_GCC=3.4 as it's no longer necessary.novel2010-01-221-1/+0
* bump PORTREVISION for the recent update ofoliver2010-01-103-3/+3
* - Update MASTER_SITES and WWW: linemiwi2010-01-054-33/+31
* - Update MASTER_SITES and WWW: linemiwi2010-01-055-27/+35
* - Update MASTER_SITES and WWW: linemiwi2010-01-055-48/+30
* For ports maintained by ports@FreeBSD.org, remove names and/ordougb2009-12-2110-22/+0
* The FreeBSD KDE is please to announce the release of KDE 4.3.4,miwi2009-12-021-3/+3
* The KDE FreeBSD team is proud to announce the release of KDE 4.3.3miwi2009-11-271-3/+3
* Update MASTER_SITES and remove WWW, project page disappeared.ehaupt2009-11-182-4/+1
* - Update to Maintianer Mail adressmiwi2009-09-122-2/+2
* - Update to 2.30wxs2009-09-102-4/+4
* The FreeBSD KDE is please to announce the release of KDE 4.3.1,tabthorpe2009-09-021-3/+3
* Reset chinsan@FreeBSD.org due to numerous maintainer-timeouts and nolinimon2009-08-291-1/+1
* Reset beech@FreeBSD.org while he works on restoring his email situation.linimon2009-08-292-3/+1
* - Update to 2.29wxs2009-08-252-4/+4
* - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-2/+1
* Mk/bsd.kde4.mk:makc2009-08-101-3/+0
* Drop maintainership of some ports I do not use or have interest foranders2009-08-051-1/+1
* The KDE FreeBSD team is proud to announce the release of KDE 4.3.0miwi2009-08-052-4/+3
* -Repocopy devel/libtool15 -> libtool22 and libltdl15 -> libltdl22.mezz2009-08-032-2/+2
* - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-3116-12/+16
* Geek Clock is a plasma applet for KDE4 that displays an analog clock. Insteadmiwi2009-07-134-0/+38
* - Update to 2.27wxs2009-06-282-5/+4
* Convert most of remaining ports that depend on xorg-libraries toamdmi32009-06-0910-10/+20
* The KDE FreeBSD team is pleased to announce KDE 4.2.4, the last bugfixmiwi2009-06-032-4/+4
* Update KDE ports to 4.2.3makc2009-05-101-3/+3
* - Mark my ports as MAKE_JOBS_SAFE (with the exception of nethack34-gnome whichwxs2009-05-091-0/+1
* update xfce to 4.6.1oliver2009-05-063-3/+3
* - Don't rely on misc/iso-codes. Instead use a file from base.wxs2009-04-231-4/+3
* - Mark all kde4 ports MAKE_JOBS_UNSAFEmiwi2009-04-171-1/+1
* The KDE FreeBSD team is proud to announce the release of KDE 4.2.2miwi2009-04-022-4/+4
* . Fix a buffer overrun on start up.glewis2009-04-022-1/+79
* Mark all my ports as MAKE_JOBS_SAFE and MAKE_JOBS_UNSAFEgarga2009-03-291-0/+1
* Mark MAKE_JOBS_SAFEehaupt2009-03-271-0/+1
* Fix CATEGORIES.flz2009-03-261-1/+2
* bump PORTREVISION after cmake updatemakc2009-03-251-0/+1
* Move oclock from x11 to x11-clocks category.flz2009-03-231-0/+1
* - fix plist with -DNOPORTDOCSitetcu2009-03-221-4/+9
* Update KDE to 4.2.1.makc2009-03-091-3/+3
* Bump PORTREVISION after xfce 4.6 updateoliver2009-03-063-1/+3
* - Pass maintainership to submittertabthorpe2009-03-021-1/+1
* - Change default Tcl/Tk version to 8.5mm2009-02-231-1/+1
* The KDE FreeBSD team is proud to announce the release of KDE 4.2.0miwi2009-02-093-33/+8
* Finish repomove for xclock (x11->x11-clocks).flz2009-01-292-1/+2
* - Update X.org ports to 7.4+ (few ports are more recent than the katamari).flz2009-01-243-5/+4
* - add LICENSE:dinoex2009-01-172-0/+4
* kde@freebsd team is pleased to announce KDE 4.1.4, the last bugfix release in...makc2009-01-142-4/+4
* - fix buffer overrun at startupdinoex2008-12-052-1/+77
* - use DOCSDIRitetcu2008-11-242-6/+6
* - Update to 0.6.1miwi2008-11-228-12/+27
* - Add MASTER_SITE_GENTOO to MASTER_SITESgarga2008-10-173-6/+11
* Reset infofarmer due to maintainer-timeouts and no response to email.linimon2008-09-071-1/+1
* The KDE FreeBSD team is proud to announce the release of KDE 4.1.1miwi2008-09-032-3/+13
* Add the dependency on tk-wrapperedwin2008-08-301-0/+2
* The KDE FreeBSD team is proud to announce the releasemiwi2008-08-291-3/+3
* USE_TK -> USE_TK_RUNedwin2008-08-281-1/+1
* Stopwatch does what its name implies - enables hand timing muchedwin2008-08-285-0/+49
* Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-212-2/+0
* The KDE FreeBSD team is proud to announce the releasemiwi2008-08-182-4/+3
* The KDE FreeBSD team is proud to announce the release of KDE 4.1.0miwi2008-08-105-178/+53
* - Update to 0.9.11.2miwi2008-08-083-4/+15
* - Remove USE_GCC where it can be satisfied with base compiler on followingpav2008-07-251-1/+0
* Alarm Clock is the personal alarm clock for GNOME desktop environment. Itmiwi2008-07-195-0/+108
* - Update to 0.6.0miwi2008-07-153-9/+23
* - Disable imlib support, which does not workgahr2008-07-071-15/+5
* Bump portrevision due to upgrade of devel/gettext.edwin2008-06-0623-20/+23
* 3dinoex2008-04-301-1/+1
* - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-2028-48/+48
* Change maintainers e-mail address.ehaupt2008-04-111-2/+2