25 |
26 |
27 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_f.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['set',['Set',['../class_w_s_t_m_1_1_w_var.html#a0f80054e64f3cdd618217f906f036ef8',1,'WSTM::WVar::Set(param_type val, WAtomic &at)'],['../class_w_s_t_m_1_1_w_var.html#a26fdd7a50efda81a322aaaf5eae4b3d5',1,'WSTM::WVar::Set(param_type val)'],['../class_w_s_t_m_1_1_w_transaction_local_value.html#a68c92752fbc8b8bfe3164ca5285c524a',1,'WSTM::WTransactionLocalValue::Set(const Type_t &value, WAtomic &at)'],['../class_w_s_t_m_1_1_w_transaction_local_value.html#a15f16162ef3c4c5b02a1e1101c4b4666',1,'WSTM::WTransactionLocalValue::Set(Type_t &&value, WAtomic &at)']]],
4 | ['setreaderinitfunc',['SetReaderInitFunc',['../class_w_s_t_m_1_1_w_channel.html#a19a50aec1253c74f28093d6f35dc853f',1,'WSTM::WChannel']]],
5 | ['size',['size',['../class_w_s_t_m_1_1_w_persistent_list.html#a153f10f500ca45325e8d5e8635db6b0f',1,'WSTM::WPersistentList']]],
6 | ['splithead',['splitHead',['../group___persist_list.html#ga5ece2c86e8766ea352cbe399c6c5a78f',1,'WSTM']]],
7 | ['startprofiling',['StartProfiling',['../group__profiling.html#ga4c5ffe9a6773cabbd9e32a26fd78d04a',1,'WSTM']]],
8 | ['stm_2eh',['stm.h',['../stm_8h.html',1,'']]]
9 | ];
10 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_10.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['testandset',['TestAndSet',['../class_w_s_t_m_1_1_w_transaction_local_flag.html#a990e4ad558611da12833b333ed19fa14',1,'WSTM::WTransactionLocalFlag']]],
4 | ['throw',['THROW',['../struct_w_s_t_m_1_1_w_conflict_resolution.html#a51c258e38488251484ab282cb5e963ababddfd41b75b056e1b801fd20ba86e452',1,'WSTM::WConflictResolution']]],
5 | ['throwcaptured',['ThrowCaptured',['../class_w_s_t_m_1_1_w_exception_capture.html#adf4fa94ac17d1de187625277dbf48c55',1,'WSTM::WExceptionCapture::ThrowCaptured() const '],['../class_w_s_t_m_1_1_w_exception_capture.html#a27624edf36c662961090a48db9c10882',1,'WSTM::WExceptionCapture::ThrowCaptured(WAtomic &at) const ']]],
6 | ['throwerror',['ThrowError',['../class_w_s_t_m_1_1_w_deferred_result.html#ae5fe8d7aab0fb144a19a7682cd8b58bf',1,'WSTM::WDeferredResult::ThrowError() const '],['../class_w_s_t_m_1_1_w_deferred_result.html#ab8b6cd5859f41738a0a0ea0791de20a4',1,'WSTM::WDeferredResult::ThrowError(WAtomic &at) const ']]],
7 | ['time_5fpoint',['time_point',['../struct_w_s_t_m_1_1_w_time_arg.html#adac62096ba896e7c7421c7421feb9a12',1,'WSTM::WTimeArg']]],
8 | ['type',['Type',['../class_w_s_t_m_1_1_w_var.html#af8581654ae96f61c47e785e26046fdaf',1,'WSTM::WVar']]]
9 | ];
10 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_3.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['disconnect',['Disconnect',['../class_w_s_t_m_1_1_w_deferred_result_1_1_w_connection.html#a22176672868575f70654e9c46bb1330d',1,'WSTM::WDeferredResult::WConnection::Disconnect()'],['../class_w_s_t_m_1_1_w_deferred_result_1_1_w_connection.html#a990e07801e032c1cb4a94d45345bec29',1,'WSTM::WDeferredResult::WConnection::Disconnect(WAtomic &at)']]],
4 | ['done',['Done',['../class_w_s_t_m_1_1_w_deferred_value.html#aa48ca151eeaf4ebdd3e5a38af239aa8b',1,'WSTM::WDeferredValue::Done(const Result_t &res)'],['../class_w_s_t_m_1_1_w_deferred_value.html#a9fb43bd8a5dfe74e0b619ad21f555439',1,'WSTM::WDeferredValue::Done(const Result_t &res, WAtomic &at)'],['../class_w_s_t_m_1_1_w_deferred_value_3_01void_01_4.html#adecf86e402db8b0050abe6298568758f',1,'WSTM::WDeferredValue< void >::Done()'],['../class_w_s_t_m_1_1_w_deferred_value_3_01void_01_4.html#a19bb65a7f163fb3551de7dd0b671a1bc',1,'WSTM::WDeferredValue< void >::Done(WAtomic &at)']]],
5 | ['donedeferred',['DoneDeferred',['../group___deferred_result.html#gaab4595663bae08336f927017ac7031e6',1,'WSTM::DoneDeferred(const Result_t &res)'],['../group___deferred_result.html#ga24ae298be45aa28491c29dc1aa337863',1,'WSTM::DoneDeferred()']]]
6 | ];
7 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_b.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['peek',['Peek',['../class_w_s_t_m_1_1_w_channel_reader.html#a9b527fc69da36e7e3ec572b1af21acb7',1,'WSTM::WChannelReader::Peek()'],['../class_w_s_t_m_1_1_w_channel_reader.html#aaa33415cac0a708893336f50ec365f21',1,'WSTM::WChannelReader::Peek(WAtomic &at)']]],
4 | ['pop_5fback',['pop_back',['../class_w_s_t_m_1_1_w_persistent_list.html#a30b7006eb910707bcddd03d55f648c9c',1,'WSTM::WPersistentList::pop_back()'],['../group___persist_list.html#ga5ef766632077036ee75b24694701b8ec',1,'WSTM::pop_back()']]],
5 | ['pop_5ffront',['pop_front',['../class_w_s_t_m_1_1_w_persistent_list.html#a5c2eedcae3ea49e5c553d98773a8e35f',1,'WSTM::WPersistentList::pop_front()'],['../group___persist_list.html#gab3fabdfbac50c48f649c19c3c4780459',1,'WSTM::pop_front()']]],
6 | ['push_5fback',['push_back',['../class_w_s_t_m_1_1_w_persistent_list.html#a75917fab98e865d924bb52bd251c1a9e',1,'WSTM::WPersistentList::push_back()'],['../group___persist_list.html#ga26f3874d17ae3068ebb2df7f3c2f6dea',1,'WSTM::push_back()']]],
7 | ['push_5ffront',['push_front',['../class_w_s_t_m_1_1_w_persistent_list.html#adb848e38d0234ce94a8f47769d428b8a',1,'WSTM::WPersistentList::push_front()'],['../group___persist_list.html#gaca31d18503702c95a71e919541fb3544',1,'WSTM::push_front()']]]
8 | ];
9 |
--------------------------------------------------------------------------------
/doc/ref/html/tabs.css:
--------------------------------------------------------------------------------
1 | .tabs, .tabs2, .tabs3 {
2 | background-image: url('tab_b.png');
3 | width: 100%;
4 | z-index: 101;
5 | font-size: 13px;
6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
7 | }
8 |
9 | .tabs2 {
10 | font-size: 10px;
11 | }
12 | .tabs3 {
13 | font-size: 9px;
14 | }
15 |
16 | .tablist {
17 | margin: 0;
18 | padding: 0;
19 | display: table;
20 | }
21 |
22 | .tablist li {
23 | float: left;
24 | display: table-cell;
25 | background-image: url('tab_b.png');
26 | line-height: 36px;
27 | list-style: none;
28 | }
29 |
30 | .tablist a {
31 | display: block;
32 | padding: 0 20px;
33 | font-weight: bold;
34 | background-image:url('tab_s.png');
35 | background-repeat:no-repeat;
36 | background-position:right;
37 | color: #283A5D;
38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
39 | text-decoration: none;
40 | outline: none;
41 | }
42 |
43 | .tabs3 .tablist a {
44 | padding: 0 10px;
45 | }
46 |
47 | .tablist a:hover {
48 | background-image: url('tab_h.png');
49 | background-repeat:repeat-x;
50 | color: #fff;
51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
52 | text-decoration: none;
53 | }
54 |
55 | .tablist li.current a {
56 | background-image: url('tab_a.png');
57 | background-repeat:repeat-x;
58 | color: #fff;
59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
60 | }
61 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Wyatt Technology Corporation
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are
6 | met:
7 |
8 | 1. Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | 3. Neither the name of the copyright holder nor the names of its
16 | contributors may be used to endorse or promote products derived from
17 | this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_2.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['capture',['Capture',['../class_w_s_t_m_1_1_w_exception_capture.html#a97d241f37a20201671c19e9446cf1fae',1,'WSTM::WExceptionCapture::Capture(const WExceptionCapture &exc)'],['../class_w_s_t_m_1_1_w_exception_capture.html#ac421aa6f17c3d992f20f0fdf8220800f',1,'WSTM::WExceptionCapture::Capture(const WExceptionCapture &exc, WAtomic &at)'],['../class_w_s_t_m_1_1_w_exception_capture.html#a60d833eea492aacdb325ba7efb177ac2',1,'WSTM::WExceptionCapture::Capture(const Capture_t &exc)'],['../class_w_s_t_m_1_1_w_exception_capture.html#a6c1270c52b2b2096a165e84d315f1761',1,'WSTM::WExceptionCapture::Capture(const Capture_t &exc, WAtomic &at)']]],
4 | ['checkpoint',['Checkpoint',['../group__profiling.html#ga783dcf9ae89fa33e5237063a2c9e0227',1,'WSTM']]],
5 | ['clear',['clear',['../class_w_s_t_m_1_1_w_persistent_list.html#a5487c21a94e09aac2c1eed0f0871b1a6',1,'WSTM::WPersistentList']]],
6 | ['concat',['concat',['../class_w_s_t_m_1_1_w_persistent_list.html#adb56ad5bb418e09cec2139a25bda6229',1,'WSTM::WPersistentList']]],
7 | ['connecttowritesignal',['ConnectToWriteSignal',['../class_w_s_t_m_1_1_w_channel.html#a181dd845e2f95f3600b28b766ffd4ae4',1,'WSTM::WChannel::ConnectToWriteSignal()'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a75e70c90a0b854743ab8b292269edca0',1,'WSTM::WReadOnlyChannel::ConnectToWriteSignal()']]],
8 | ['copy',['Copy',['../class_w_s_t_m_1_1_w_channel_reader.html#ae68b5d4b3fbe99f1cec40f24c1f20594',1,'WSTM::WChannelReader::Copy()'],['../class_w_s_t_m_1_1_w_deferred_result.html#a8e1f664c66c989f8819c88fd5db0bd1a',1,'WSTM::WDeferredResult::Copy()']]]
9 | ];
10 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_d.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['param_5ftype',['param_type',['../class_w_s_t_m_1_1_w_var.html#a6209c237a548c0cc3e99e13eaac26a19',1,'WSTM::WVar']]],
4 | ['peek',['Peek',['../class_w_s_t_m_1_1_w_channel_reader.html#a9b527fc69da36e7e3ec572b1af21acb7',1,'WSTM::WChannelReader::Peek()'],['../class_w_s_t_m_1_1_w_channel_reader.html#aaa33415cac0a708893336f50ec365f21',1,'WSTM::WChannelReader::Peek(WAtomic &at)']]],
5 | ['persistent_5flist_2eh',['persistent_list.h',['../persistent__list_8h.html',1,'']]],
6 | ['persistent_20list',['Persistent List',['../group___persist_list.html',1,'']]],
7 | ['pop_5fback',['pop_back',['../class_w_s_t_m_1_1_w_persistent_list.html#a30b7006eb910707bcddd03d55f648c9c',1,'WSTM::WPersistentList::pop_back()'],['../group___persist_list.html#ga5ef766632077036ee75b24694701b8ec',1,'WSTM::pop_back()']]],
8 | ['pop_5ffront',['pop_front',['../class_w_s_t_m_1_1_w_persistent_list.html#a5c2eedcae3ea49e5c553d98773a8e35f',1,'WSTM::WPersistentList::pop_front()'],['../group___persist_list.html#gab3fabdfbac50c48f649c19c3c4780459',1,'WSTM::pop_front()']]],
9 | ['profiling',['Profiling',['../group__profiling.html',1,'']]],
10 | ['push_5fback',['push_back',['../class_w_s_t_m_1_1_w_persistent_list.html#a75917fab98e865d924bb52bd251c1a9e',1,'WSTM::WPersistentList::push_back()'],['../group___persist_list.html#ga26f3874d17ae3068ebb2df7f3c2f6dea',1,'WSTM::push_back()']]],
11 | ['push_5ffront',['push_front',['../class_w_s_t_m_1_1_w_persistent_list.html#adb848e38d0234ce94a8f47769d428b8a',1,'WSTM::WPersistentList::push_front()'],['../group___persist_list.html#gaca31d18503702c95a71e919541fb3544',1,'WSTM::push_front()']]]
12 | ];
13 |
--------------------------------------------------------------------------------
/doc/ref/html/search/variables_0.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['m_5fend',['m_end',['../struct_w_s_t_m_1_1_w_profile_data.html#a27112f2787e43b6669a1db69f6f96f44',1,'WSTM::WProfileData']]],
4 | ['m_5fmax',['m_max',['../struct_w_s_t_m_1_1_w_max_conflicts.html#a00796920ad9dc2e7d628f252262be0bb',1,'WSTM::WMaxConflicts']]],
5 | ['m_5fmsg',['m_msg',['../struct_w_s_t_m_1_1_w_channel_error.html#a74296d177caedd8f58960a6a8c6f7df1',1,'WSTM::WChannelError::m_msg()'],['../struct_w_s_t_m_1_1_w_exception.html#a374590d064848ce40dc5cda57d9360c2',1,'WSTM::WException::m_msg()']]],
6 | ['m_5fnumconflicts',['m_numConflicts',['../struct_w_s_t_m_1_1_w_profile_data.html#a2d55c21ab2e086e465bc3d7f0ad7ee76',1,'WSTM::WProfileData']]],
7 | ['m_5fnumreadcommits',['m_numReadCommits',['../struct_w_s_t_m_1_1_w_profile_data.html#a247200698bb9e94b986cfce818b05b63',1,'WSTM::WProfileData']]],
8 | ['m_5fnumwritecommits',['m_numWriteCommits',['../struct_w_s_t_m_1_1_w_profile_data.html#a5841020a94cbcd48cd71ee610bc268f0',1,'WSTM::WProfileData']]],
9 | ['m_5fresolution',['m_resolution',['../struct_w_s_t_m_1_1_w_max_conflicts.html#af1ed5a48b95ab02c88be2083bb710ee8',1,'WSTM::WMaxConflicts']]],
10 | ['m_5fstart',['m_start',['../struct_w_s_t_m_1_1_w_profile_data.html#ab9d1b3a6a113f49f067fe01cfb5211e3',1,'WSTM::WProfileData']]],
11 | ['m_5ftime_5fo',['m_time_o',['../struct_w_s_t_m_1_1_w_time_arg.html#a0e19c19961b58f638fa7bc4eb32d0855',1,'WSTM::WTimeArg']]],
12 | ['m_5fvalue',['m_value',['../struct_w_s_t_m_1_1_w_max_retries.html#a663694116df83dd4783603b0d004420c',1,'WSTM::WMaxRetries::m_value()'],['../struct_w_s_t_m_1_1_w_max_retry_wait.html#ab479167ba36e33d7eb3f1b95f5637516',1,'WSTM::WMaxRetryWait::m_value()']]]
13 | ];
14 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_5.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['fail',['Fail',['../class_w_s_t_m_1_1_w_deferred_value_base.html#a4548eb89b0ffc471356fd95a7d6db2e7',1,'WSTM::WDeferredValueBase::Fail(const Fail_t &failure)'],['../class_w_s_t_m_1_1_w_deferred_value_base.html#a0e12fc0b1c4c8ee122abb290e90f2ca8',1,'WSTM::WDeferredValueBase::Fail(const Fail_t &failure, WAtomic &at)']]],
4 | ['faildeferred',['FailDeferred',['../group___deferred_result.html#gae9c2476ffcc30d998c7dceaf6bf068bd',1,'WSTM']]],
5 | ['failed',['Failed',['../class_w_s_t_m_1_1_w_deferred_result.html#a0f629b7a4aec8d0a12a01ac649cde587',1,'WSTM::WDeferredResult::Failed() const '],['../class_w_s_t_m_1_1_w_deferred_result.html#aa72841e11fda3bbb143aae50f5cb02d7',1,'WSTM::WDeferredResult::Failed(WAtomic &at) const ']]],
6 | ['fbegin',['fbegin',['../class_w_s_t_m_1_1_w_persistent_list.html#a38e002f869ec2e0c0cb9942d006e0b48',1,'WSTM::WPersistentList::fbegin()'],['../class_w_s_t_m_1_1_w_persistent_list.html#ac0f84cbad95fd9ad6473afbcf31ff1da',1,'WSTM::WPersistentList::fbegin() const ']]],
7 | ['fend',['fend',['../class_w_s_t_m_1_1_w_persistent_list.html#a13bd4b78570a4cbbddcb05e1b2481df6',1,'WSTM::WPersistentList::fend()'],['../class_w_s_t_m_1_1_w_persistent_list.html#aee3988d60e7f6539e5f82b84fb60c779',1,'WSTM::WPersistentList::fend() const ']]],
8 | ['findarg',['findArg',['../group___find_arg.html#ga719f47213efd8717c9495ee280c5ff76',1,'WSTM']]],
9 | ['formatdata',['FormatData',['../struct_w_s_t_m_1_1_w_profile_data.html#a05adf614790bdc1a20bf8feb8dc153a3',1,'WSTM::WProfileData']]],
10 | ['front',['front',['../class_w_s_t_m_1_1_w_persistent_list.html#a84f2174e691d5c9e427a7ea9d12428b5',1,'WSTM::WPersistentList']]]
11 | ];
12 |
--------------------------------------------------------------------------------
/src/exception.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #include "exception.h"
32 |
33 | namespace WSTM
34 | {
35 | WException::WException (const std::string& msg):
36 | std::runtime_error (msg)
37 | {}
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/wstm/exports.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #pragma once
32 |
33 | //CMake sets these appropriately for dynamics vs. static libs in the project files for visual studio builds
34 | #ifndef WSTM_LIBAPI
35 | #define WSTM_LIBAPI
36 | #endif
37 | #ifndef WSTM_CLASSAPI
38 | #define WSTM_CLASSAPI
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/persistent_list.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #include "persistent_list.h"
32 |
33 | namespace WSTM
34 | {
35 | WInvalidIteratorError::WInvalidIteratorError ():
36 | WException ("WPersistentList iterator is invalid")
37 | {}
38 |
39 | WNoElementError::WNoElementError ():
40 | WException ("WPersistentList is empty")
41 | {}
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/testing/unit-tests/main.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 |
32 | #define BOOST_TEST_MODULE wstm-tests
33 | #include
34 |
35 | #ifdef NON_APPLE_CLANG
36 | //Clang on linux is missing this
37 | extern "C" int __cxa_thread_atexit(void (*func)(), void *obj, void *dso_symbol)
38 | {
39 | int __cxa_thread_atexit_impl(void (*)(), void *, void *);
40 | return __cxa_thread_atexit_impl(func, obj, dso_symbol);
41 | }
42 | #endif //NON_APPLE_CLANG
43 |
--------------------------------------------------------------------------------
/wstm/exception.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #pragma once
32 |
33 | #include "exports.h"
34 |
35 | #include
36 |
37 | namespace WSTM
38 | {
39 | /**
40 | * Base class for all exceptions thrown by WSTM functions.
41 | */
42 | struct WSTM_CLASSAPI WException : public std::runtime_error
43 | {
44 | /**
45 | * Creates an exception.
46 | *
47 | * @param msg The exception's message.
48 | */
49 | WException (const std::string& msg);
50 | };
51 | }
52 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_3.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['data',['Data',['../class_w_s_t_m_1_1_w_channel.html#abd107a26fe4bde3b68e8b7af87a235f9',1,'WSTM::WChannel::Data()'],['../class_w_s_t_m_1_1_w_read_only_channel.html#abe73dfd492e7a5c5daa8c9fe69435750',1,'WSTM::WReadOnlyChannel::Data()'],['../class_w_s_t_m_1_1_w_channel_writer.html#ac4358b217d961d8024705d09ead3bdc9',1,'WSTM::WChannelWriter::Data()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a53bfc3fefcd9a9d038afc58f7f37de10',1,'WSTM::WChannelReader::Data()']]],
4 | ['dataopt',['DataOpt',['../class_w_s_t_m_1_1_w_channel_reader.html#a780ad84da1429cf06eef9d4393c941b3',1,'WSTM::WChannelReader']]],
5 | ['deferred_5fresult_2eh',['deferred_result.h',['../deferred__result_8h.html',1,'']]],
6 | ['deferred_20results',['Deferred Results',['../group___deferred_result.html',1,'']]],
7 | ['disconnect',['Disconnect',['../class_w_s_t_m_1_1_w_deferred_result_1_1_w_connection.html#a22176672868575f70654e9c46bb1330d',1,'WSTM::WDeferredResult::WConnection::Disconnect()'],['../class_w_s_t_m_1_1_w_deferred_result_1_1_w_connection.html#a990e07801e032c1cb4a94d45345bec29',1,'WSTM::WDeferredResult::WConnection::Disconnect(WAtomic &at)']]],
8 | ['done',['Done',['../class_w_s_t_m_1_1_w_deferred_value.html#aa48ca151eeaf4ebdd3e5a38af239aa8b',1,'WSTM::WDeferredValue::Done(const Result_t &res)'],['../class_w_s_t_m_1_1_w_deferred_value.html#a9fb43bd8a5dfe74e0b619ad21f555439',1,'WSTM::WDeferredValue::Done(const Result_t &res, WAtomic &at)'],['../class_w_s_t_m_1_1_w_deferred_value_3_01void_01_4.html#adecf86e402db8b0050abe6298568758f',1,'WSTM::WDeferredValue< void >::Done()'],['../class_w_s_t_m_1_1_w_deferred_value_3_01void_01_4.html#a19bb65a7f163fb3551de7dd0b671a1bc',1,'WSTM::WDeferredValue< void >::Done(WAtomic &at)']]],
9 | ['donecallback',['DoneCallback',['../class_w_s_t_m_1_1_w_deferred_result.html#acc56b4a7fdb557ff5222bf2c917b29f5',1,'WSTM::WDeferredResult']]],
10 | ['donedeferred',['DoneDeferred',['../group___deferred_result.html#gaab4595663bae08336f927017ac7031e6',1,'WSTM::DoneDeferred(const Result_t &res)'],['../group___deferred_result.html#ga24ae298be45aa28491c29dc1aa337863',1,'WSTM::DoneDeferred()']]]
11 | ];
12 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_5.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['fail',['Fail',['../class_w_s_t_m_1_1_w_deferred_value_base.html#a4548eb89b0ffc471356fd95a7d6db2e7',1,'WSTM::WDeferredValueBase::Fail(const Fail_t &failure)'],['../class_w_s_t_m_1_1_w_deferred_value_base.html#a0e12fc0b1c4c8ee122abb290e90f2ca8',1,'WSTM::WDeferredValueBase::Fail(const Fail_t &failure, WAtomic &at)']]],
4 | ['faildeferred',['FailDeferred',['../group___deferred_result.html#gae9c2476ffcc30d998c7dceaf6bf068bd',1,'WSTM']]],
5 | ['failed',['Failed',['../class_w_s_t_m_1_1_w_deferred_result.html#a0f629b7a4aec8d0a12a01ac649cde587',1,'WSTM::WDeferredResult::Failed() const '],['../class_w_s_t_m_1_1_w_deferred_result.html#aa72841e11fda3bbb143aae50f5cb02d7',1,'WSTM::WDeferredResult::Failed(WAtomic &at) const ']]],
6 | ['fbegin',['fbegin',['../class_w_s_t_m_1_1_w_persistent_list.html#a38e002f869ec2e0c0cb9942d006e0b48',1,'WSTM::WPersistentList::fbegin()'],['../class_w_s_t_m_1_1_w_persistent_list.html#ac0f84cbad95fd9ad6473afbcf31ff1da',1,'WSTM::WPersistentList::fbegin() const ']]],
7 | ['fend',['fend',['../class_w_s_t_m_1_1_w_persistent_list.html#a13bd4b78570a4cbbddcb05e1b2481df6',1,'WSTM::WPersistentList::fend()'],['../class_w_s_t_m_1_1_w_persistent_list.html#aee3988d60e7f6539e5f82b84fb60c779',1,'WSTM::WPersistentList::fend() const ']]],
8 | ['find_5farg_2eh',['find_arg.h',['../find__arg_8h.html',1,'']]],
9 | ['find_5farg_5f_5fmake_5farg_5ftype',['FIND_ARG__MAKE_ARG_TYPE',['../group___find_arg.html#ga8fd70beebee10529d7c6c66a807f513d',1,'find_arg.h']]],
10 | ['findarg',['findArg',['../group___find_arg.html#ga719f47213efd8717c9495ee280c5ff76',1,'WSTM']]],
11 | ['formatdata',['FormatData',['../struct_w_s_t_m_1_1_w_profile_data.html#a05adf614790bdc1a20bf8feb8dc153a3',1,'WSTM::WProfileData']]],
12 | ['forward_5fiter',['forward_iter',['../class_w_s_t_m_1_1_w_persistent_list_1_1forward__iter.html',1,'WSTM::WPersistentList']]],
13 | ['forward_5fiterator',['forward_iterator',['../class_w_s_t_m_1_1_w_persistent_list.html#a922e82b30d1851ef88936279f55e004f',1,'WSTM::WPersistentList']]],
14 | ['front',['front',['../class_w_s_t_m_1_1_w_persistent_list.html#a84f2174e691d5c9e427a7ea9d12428b5',1,'WSTM::WPersistentList']]]
15 | ];
16 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_2.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['capture',['Capture',['../class_w_s_t_m_1_1_w_exception_capture.html#a97d241f37a20201671c19e9446cf1fae',1,'WSTM::WExceptionCapture::Capture(const WExceptionCapture &exc)'],['../class_w_s_t_m_1_1_w_exception_capture.html#ac421aa6f17c3d992f20f0fdf8220800f',1,'WSTM::WExceptionCapture::Capture(const WExceptionCapture &exc, WAtomic &at)'],['../class_w_s_t_m_1_1_w_exception_capture.html#a60d833eea492aacdb325ba7efb177ac2',1,'WSTM::WExceptionCapture::Capture(const Capture_t &exc)'],['../class_w_s_t_m_1_1_w_exception_capture.html#a6c1270c52b2b2096a165e84d315f1761',1,'WSTM::WExceptionCapture::Capture(const Capture_t &exc, WAtomic &at)']]],
4 | ['channel_2eh',['channel.h',['../channel_8h.html',1,'']]],
5 | ['checkpoint',['Checkpoint',['../group__profiling.html#ga783dcf9ae89fa33e5237063a2c9e0227',1,'WSTM']]],
6 | ['clear',['clear',['../class_w_s_t_m_1_1_w_persistent_list.html#a5487c21a94e09aac2c1eed0f0871b1a6',1,'WSTM::WPersistentList']]],
7 | ['concat',['concat',['../class_w_s_t_m_1_1_w_persistent_list.html#adb56ad5bb418e09cec2139a25bda6229',1,'WSTM::WPersistentList']]],
8 | ['connecttowritesignal',['ConnectToWriteSignal',['../class_w_s_t_m_1_1_w_channel.html#a181dd845e2f95f3600b28b766ffd4ae4',1,'WSTM::WChannel::ConnectToWriteSignal()'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a75e70c90a0b854743ab8b292269edca0',1,'WSTM::WReadOnlyChannel::ConnectToWriteSignal()']]],
9 | ['const_5fforward_5fiterator',['const_forward_iterator',['../class_w_s_t_m_1_1_w_persistent_list.html#a9ed71e2035ee68c03ae1a25af14c9626',1,'WSTM::WPersistentList']]],
10 | ['const_5fiterator',['const_iterator',['../class_w_s_t_m_1_1_w_persistent_list.html#ac3d3d451796072c5208caf8af6f25540',1,'WSTM::WPersistentList']]],
11 | ['const_5freverse_5fiterator',['const_reverse_iterator',['../class_w_s_t_m_1_1_w_persistent_list.html#a60acc66e00ec03d6fed14ccbee5f1a97',1,'WSTM::WPersistentList']]],
12 | ['copy',['Copy',['../class_w_s_t_m_1_1_w_channel_reader.html#ae68b5d4b3fbe99f1cec40f24c1f20594',1,'WSTM::WChannelReader::Copy()'],['../class_w_s_t_m_1_1_w_deferred_result.html#a8e1f664c66c989f8819c88fd5db0bd1a',1,'WSTM::WDeferredResult::Copy()']]],
13 | ['core',['Core',['../group___core.html',1,'']]]
14 | ];
15 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_a.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['multi_2dcast_20channels',['Multi-cast Channels',['../group___channel.html',1,'']]],
4 | ['m_5fend',['m_end',['../struct_w_s_t_m_1_1_w_profile_data.html#a27112f2787e43b6669a1db69f6f96f44',1,'WSTM::WProfileData']]],
5 | ['m_5fmax',['m_max',['../struct_w_s_t_m_1_1_w_max_conflicts.html#a00796920ad9dc2e7d628f252262be0bb',1,'WSTM::WMaxConflicts']]],
6 | ['m_5fmsg',['m_msg',['../struct_w_s_t_m_1_1_w_channel_error.html#a74296d177caedd8f58960a6a8c6f7df1',1,'WSTM::WChannelError::m_msg()'],['../struct_w_s_t_m_1_1_w_exception.html#a374590d064848ce40dc5cda57d9360c2',1,'WSTM::WException::m_msg()']]],
7 | ['m_5fnumconflicts',['m_numConflicts',['../struct_w_s_t_m_1_1_w_profile_data.html#a2d55c21ab2e086e465bc3d7f0ad7ee76',1,'WSTM::WProfileData']]],
8 | ['m_5fnumreadcommits',['m_numReadCommits',['../struct_w_s_t_m_1_1_w_profile_data.html#a247200698bb9e94b986cfce818b05b63',1,'WSTM::WProfileData']]],
9 | ['m_5fnumwritecommits',['m_numWriteCommits',['../struct_w_s_t_m_1_1_w_profile_data.html#a5841020a94cbcd48cd71ee610bc268f0',1,'WSTM::WProfileData']]],
10 | ['m_5fresolution',['m_resolution',['../struct_w_s_t_m_1_1_w_max_conflicts.html#af1ed5a48b95ab02c88be2083bb710ee8',1,'WSTM::WMaxConflicts']]],
11 | ['m_5fstart',['m_start',['../struct_w_s_t_m_1_1_w_profile_data.html#ab9d1b3a6a113f49f067fe01cfb5211e3',1,'WSTM::WProfileData']]],
12 | ['m_5ftime_5fo',['m_time_o',['../struct_w_s_t_m_1_1_w_time_arg.html#a0e19c19961b58f638fa7bc4eb32d0855',1,'WSTM::WTimeArg']]],
13 | ['m_5fvalue',['m_value',['../struct_w_s_t_m_1_1_w_max_retries.html#a663694116df83dd4783603b0d004420c',1,'WSTM::WMaxRetries::m_value()'],['../struct_w_s_t_m_1_1_w_max_retry_wait.html#ab479167ba36e33d7eb3f1b95f5637516',1,'WSTM::WMaxRetryWait::m_value()']]],
14 | ['makereader',['MakeReader',['../group___channel.html#ga79179fcd729920a6f198fcb5948055f4',1,'WSTM::MakeReader(const WChannel< Data_t > &ch)'],['../group___channel.html#gab84920d2ddd891a3bb6f3e6e4318930e',1,'WSTM::MakeReader(const WChannel< Data_t > &ch, WAtomic &at)'],['../group___channel.html#ga2ccac7af3d65889363cdb16add26c0a4',1,'WSTM::MakeReader(const WReadOnlyChannel< Data_t > &ch)'],['../group___channel.html#ga2ee36b281284893215d8c64277ef23ed',1,'WSTM::MakeReader(const WReadOnlyChannel< Data_t > &ch, WAtomic &at)']]]
15 | ];
16 |
--------------------------------------------------------------------------------
/BUILDING.md:
--------------------------------------------------------------------------------
1 | # Building Wyatt-STM
2 |
3 | Wyatt-STM uses [CMake](https://cmake.org/) to generate the build systems used on various platforms. Please consult the CMake documentation for information on generating build files for your platform. In what follows we will give some platform specific tips that have worked in the past.
4 |
5 | ## Prerequisites
6 | The only external dependency of Wyatt-STM is [boost](http://boost.org). Version 1.57 or later is required (prior to 1.57 `boost::optional` lacked a move constructor).
7 |
8 | ## Build Directories
9 | It is recommended that you create a sub-directory under the source tree root and run cmake from within it. This will isolate your platform specific build artifacts from the rest of the tree and if you're using unix makefiles it will allow you to create debug and release configurations (a separate build directory for each).
10 |
11 | For example, you could do this at unix style command line starting in the root of the source tree in order to create the makefiles and then run make with them:
12 |
13 | ```
14 | bash$ mkdir debug
15 | bash$ cd debug
16 | bash$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
17 | bash$ make
18 | ```
19 |
20 | ## Windows
21 | Wyatt-STM makes extensive use of C++11 and C++14 features so the minimum version of Visual Studio that can compile it is 2015. Be sure to specify the `Visual Studio 14 2015` generator to cmake. You will probably also need to give the `BOOST_ROOT` cmake variable the correct value in order for cmake to find your boost libraries.
22 |
23 | ## Linux (GCC)
24 | GCC 4.9 or later is required, just use the `Unix Makefiles` generator (should be the default). If boost is not installed in the usual location you will probably need to specify a value for `BOOST_ROOT` when running cmake. Note that you need to specify `CMAKE_BUILD_TYPE` as either `Debug` or `Release`, if you don't specify it things will not work correctly.
25 |
26 | ## Linux (Clang)
27 | Clang 3.4 is known to work, earlier versions may work but no guarantees are being made. Again use the `Unix Makefiles` generator but this time specify the `CMAKE_C_COMPILER` as the path to `clang` and `CMAKE_CXX_COMPILER` as the path to `clang++`. If boost is not installed in the usual location you will probably need to specify a value for `BOOST_ROOT` when running cmake. Note that you need to specify `CMAKE_BUILD_TYPE` as either `Debug` or `Release`, if you don't specify it things will not work correctly.
28 |
29 | ## OSX
30 | Apple Clang 7.0 is known to work, earlier versions may work too but no guarantees are being made. You can use either the `Unix Makefiles` or `XCode` generators. If you use makefiles then you will need to specify `CMAKE_BUILD_TYPE` as either `Debug` or `Release` when running cmake, if you don't specify it things will not work correctly.
31 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_8.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['inatomic',['InAtomic',['../group___core.html#gafd3d5a4b1ddda4938ab30473b12c9502',1,'WSTM']]],
4 | ['inconsistently',['Inconsistently',['../group___core.html#gabf006fb968a6a4dae938779df0172295',1,'WSTM']]],
5 | ['inconsistentlyimpl',['InconsistentlyImpl',['../class_w_s_t_m_1_1_w_inconsistent.html#a15fa437c32d63a40e0b5b176263afbbc',1,'WSTM::WInconsistent']]],
6 | ['init',['Init',['../class_w_s_t_m_1_1_w_read_only_channel.html#a1146f6eb4cd8140efa36894609e9a978',1,'WSTM::WReadOnlyChannel::Init(const WChannel< Data_t > &chan)'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a05e8434e8fb9a28f20c6be5e836cb39a',1,'WSTM::WReadOnlyChannel::Init(const WChannel< Data_t > &chan, WAtomic &at)'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a8310dab43cb03c9c76ffade44924850c',1,'WSTM::WReadOnlyChannel::Init(const WReadOnlyChannel &chan)'],['../class_w_s_t_m_1_1_w_read_only_channel.html#af11fef99dcf97ec0f1482bfe04cef5de',1,'WSTM::WReadOnlyChannel::Init(const WReadOnlyChannel &chan, WAtomic &at)'],['../class_w_s_t_m_1_1_w_channel_writer.html#a1107e3c7cb809f280e7d2537ff4d201b',1,'WSTM::WChannelWriter::Init()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a34eca1086f535ae69ced876dffb2f8f8',1,'WSTM::WChannelReader::Init(const WChannel< Data > &ch)'],['../class_w_s_t_m_1_1_w_channel_reader.html#a9659a4e588a67fa4c38d74ea2730e768',1,'WSTM::WChannelReader::Init(const WChannel< Data > &ch, WAtomic &at)'],['../class_w_s_t_m_1_1_w_channel_reader.html#ae75d13e1963d7601239f0ff7a1277ece',1,'WSTM::WChannelReader::Init(const WReadOnlyChannel< Data > &ch)'],['../class_w_s_t_m_1_1_w_channel_reader.html#a60a9518b7dc0d6074cb6efb0a9a2a6d4',1,'WSTM::WChannelReader::Init(const WReadOnlyChannel< Data > &ch, WAtomic &at)'],['../class_w_s_t_m_1_1_w_deferred_result.html#ab40f26522863fa54163b1823ec07ef0c',1,'WSTM::WDeferredResult::Init()']]],
7 | ['insert',['insert',['../class_w_s_t_m_1_1_w_persistent_list.html#a605c2f376aff034644215cdc645a0791',1,'WSTM::WPersistentList::insert(const iterator &pos, param_type value)'],['../class_w_s_t_m_1_1_w_persistent_list.html#a77f9d30e17f00b930440940d7841137e',1,'WSTM::WPersistentList::insert(const iterator &pos, Iter_t it, Iter_t end_)']]],
8 | ['isdone',['IsDone',['../class_w_s_t_m_1_1_w_deferred_value_base.html#a8f51bd1013891d3443c524fa01ee62f7',1,'WSTM::WDeferredValueBase::IsDone() const '],['../class_w_s_t_m_1_1_w_deferred_value_base.html#a59ce17bad6e290510b667b9941596db4',1,'WSTM::WDeferredValueBase::IsDone(WAtomic &at) const '],['../class_w_s_t_m_1_1_w_deferred_result.html#afe33ad75fbddd79915a4b696b4652b30',1,'WSTM::WDeferredResult::IsDone() const '],['../class_w_s_t_m_1_1_w_deferred_result.html#a3b9fe5ddaf074318de7bfc9291a7775a',1,'WSTM::WDeferredResult::IsDone(WAtomic &at) const ']]],
9 | ['isreadlocked',['IsReadLocked',['../class_w_s_t_m_1_1_w_atomic.html#a69f9dd57bbd073af0bed993da4771a61',1,'WSTM::WAtomic::IsReadLocked()'],['../class_w_s_t_m_1_1_w_inconsistent.html#ad44a9c8381c2d5b2e3e3369d1e27dd42',1,'WSTM::WInconsistent::IsReadLocked()']]],
10 | ['isunlimited',['IsUnlimited',['../struct_w_s_t_m_1_1_w_time_arg.html#ae579201bba0dcad64d987d71db5a74da',1,'WSTM::WTimeArg']]],
11 | ['isvalid',['IsValid',['../class_w_s_t_m_1_1_w_deferred_result.html#afc610a2bb1e5568cedb1e22e468b3862',1,'WSTM::WDeferredResult']]]
12 | ];
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Wyatt-STM
2 |
3 | This is a software transactional memory (STM) system developed at Wyatt Technology for use in their [Dynamics data collection and analysis package](http://www.wyatt.com/products/software/dynamics.html). This package includes the STM library itself (including some data structures built on top of the core STM functionality) and a suite of test programs to ensure its correct functioning.
4 |
5 | ## More Information
6 |
7 | The home for this project is on [github](https://github.com/WyattTechnology/Wyatt-STM). There is also a [google group](https://groups.google.com/d/forum/wyatt-stm) for discussing usage and developement.
8 |
9 | ## Contents
10 | The main STM library is in the `wstm` (headers) and `src` (implementation) directories.
11 |
12 | In the `testing` directory there are some programs that exercise the library:
13 |
14 | * unit-tests: Unit tests for the STM library. This program uses the boost test library, for more information on command line arguments see that library's documentation.
15 |
16 | * correctness: Random stress test for the STM library. Makes random updates to a set of transactional variables in multiple threads pausing periodically to check that the library is behaving properly under load. This is meant to be run for long periods of time.
17 |
18 | * contention: Test how much contention is inherent in the STM system. This is done by running some number of threads with each thread updating its own private set of variables. The number of transactions that each thread can commit over some time period is tracked and reported. Since each thread is accessing variables that are not accessed by any other thread we won't have any contending transactions, all we're measuring is how much contention is inherent in the STM implementation itself.
19 |
20 | * channel: This is a stress test for the multi-cast channel data structure that is part of the library.
21 |
22 | ## Should I Use This?
23 |
24 | We've been using this library at Wyatt Technology in an application that we ship to customers for years now. As such it can be considered stable. While it is stable, it does have some contention issues if run with too many threads. How many threads is *too many* depends on how intensly the library is being used (at Wyatt we have no problems with up to 8 computation heavy threads plus a few more IO bound threads, all of which are making medium to heavy usage of transactions). If you are going to use the library in a non-experimental manner then it would be best to do some prototyping first to see if you get performance that is good enough for your application. At some point we plan to remove this contention, but it hasn't been enough of an issue for us at Wyatt yet for much time to be devoted to it.
25 |
26 | ## Documentation
27 | The documentation for using the library is contained in the `doc` sub-directory.
28 |
29 | ## Supported Platforms
30 | This library has been tested on Windows using Visual Studio 2015, Linux using GCC 4.9 and Clang 3.4, and OSX using Apple Clang 7.0. Earlier versions of these compilers probably won't work. It also requires the [boost](http:boost.org) library, version 1.57 or newer. For more details on building the library and associated test programs see `BUILDING.md`.
31 |
32 | ## Building
33 | See the `BUILDING.md` file for more information on building the library and associated test programs.
34 |
35 | ## License
36 | This library and its associated test programs are licensed under a BSD license, see `LICENSE` for more information.
37 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_c.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['rbegin',['rbegin',['../class_w_s_t_m_1_1_w_persistent_list.html#a86a8759302de29b1c299893e0f6444da',1,'WSTM::WPersistentList::rbegin()'],['../class_w_s_t_m_1_1_w_persistent_list.html#a3b3eb51429e4c070c12f934634c37dd9',1,'WSTM::WPersistentList::rbegin() const ']]],
4 | ['read',['Read',['../class_w_s_t_m_1_1_w_channel_reader.html#a49d89009bd830a19b4b1c59b6911ff2d',1,'WSTM::WChannelReader']]],
5 | ['readall',['ReadAll',['../class_w_s_t_m_1_1_w_channel_reader.html#aaaa258752cb47ebb4cece3fe2ebcc3e6',1,'WSTM::WChannelReader::ReadAll()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a44bfcb71d9e4608c452b3880b2456aba',1,'WSTM::WChannelReader::ReadAll(WAtomic &at)']]],
6 | ['readatomic',['ReadAtomic',['../class_w_s_t_m_1_1_w_channel_reader.html#a797752117acedad3726b06a110f2656e',1,'WSTM::WChannelReader']]],
7 | ['readlock',['ReadLock',['../class_w_s_t_m_1_1_w_atomic.html#a8037cf1cff612bfd2c244ee57d2da3e4',1,'WSTM::WAtomic::ReadLock()'],['../class_w_s_t_m_1_1_w_inconsistent.html#aef5ebab3acb1685a81607a7972da282f',1,'WSTM::WInconsistent::ReadLock()']]],
8 | ['readretry',['ReadRetry',['../class_w_s_t_m_1_1_w_channel_reader.html#ac401ab38adce4236ce0f7627b07561fc',1,'WSTM::WChannelReader']]],
9 | ['readunlock',['ReadUnlock',['../class_w_s_t_m_1_1_w_atomic.html#a2d3a41a852d05b5518da535b0e725718',1,'WSTM::WAtomic::ReadUnlock()'],['../class_w_s_t_m_1_1_w_inconsistent.html#ad29b5ddcd6a7327149ef6595fbd37166',1,'WSTM::WInconsistent::ReadUnlock()']]],
10 | ['release',['Release',['../class_w_s_t_m_1_1_w_read_only_channel.html#a70e94e75dfed945f3ed349a4794f52d7',1,'WSTM::WReadOnlyChannel::Release()'],['../class_w_s_t_m_1_1_w_read_only_channel.html#aff402f24cfa6cda54b4353fbd0595e93',1,'WSTM::WReadOnlyChannel::Release(WAtomic &at)'],['../class_w_s_t_m_1_1_w_channel_writer.html#af57c7141ccb9f2cc5656b8be10ff0980',1,'WSTM::WChannelWriter::Release()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a85295e6a8345f62fef2e174907a9de94',1,'WSTM::WChannelReader::Release()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a214da37d360303c51143019c72bfe96a',1,'WSTM::WChannelReader::Release(WAtomic &at)'],['../class_w_s_t_m_1_1_w_deferred_result.html#a487d5b6d4e848b7defcd4b42bce6f0db',1,'WSTM::WDeferredResult::Release()'],['../class_w_s_t_m_1_1_w_deferred_result.html#aab28ddd888cb6ce131854a64eb415eac',1,'WSTM::WDeferredResult::Release(WAtomic &at)']]],
11 | ['rend',['rend',['../class_w_s_t_m_1_1_w_persistent_list.html#a42ae2f7b96f12b97bd64d755552ad96b',1,'WSTM::WPersistentList::rend()'],['../class_w_s_t_m_1_1_w_persistent_list.html#a5834a5f8f4f6f782697b2354d4a9aef9',1,'WSTM::WPersistentList::rend() const ']]],
12 | ['replace',['replace',['../class_w_s_t_m_1_1_w_persistent_list.html#a9cf0f5b7982529fcb64765aec1c1500c',1,'WSTM::WPersistentList']]],
13 | ['reset',['Reset',['../class_w_s_t_m_1_1_w_exception_capture.html#afc3273d57ea64148043d6d8d21e0868e',1,'WSTM::WExceptionCapture::Reset()'],['../class_w_s_t_m_1_1_w_exception_capture.html#a48da3b0d6ff26549e7fef106eac31b5f',1,'WSTM::WExceptionCapture::Reset(WAtomic &at)']]],
14 | ['retry',['Retry',['../group___core.html#gac553425cfd41fcf60669313f91a162a3',1,'WSTM']]],
15 | ['retryifempty',['RetryIfEmpty',['../class_w_s_t_m_1_1_w_channel_reader.html#a4f8b7c5cadf15ce0f0471f9c7d26d4c0',1,'WSTM::WChannelReader']]],
16 | ['retryifnotdone',['RetryIfNotDone',['../class_w_s_t_m_1_1_w_deferred_result.html#a89f27627f46978be189c06584e1a300c',1,'WSTM::WDeferredResult']]],
17 | ['runatomically',['RunAtomically',['../group___core.html#ga79f61cd02ad11aea2a826075c1f44500',1,'WSTM']]]
18 | ];
19 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_8.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['inatomic',['InAtomic',['../group___core.html#gafd3d5a4b1ddda4938ab30473b12c9502',1,'WSTM']]],
4 | ['inconsistently',['Inconsistently',['../group___core.html#gabf006fb968a6a4dae938779df0172295',1,'WSTM']]],
5 | ['inconsistentlyimpl',['InconsistentlyImpl',['../class_w_s_t_m_1_1_w_inconsistent.html#a15fa437c32d63a40e0b5b176263afbbc',1,'WSTM::WInconsistent']]],
6 | ['init',['Init',['../class_w_s_t_m_1_1_w_read_only_channel.html#a1146f6eb4cd8140efa36894609e9a978',1,'WSTM::WReadOnlyChannel::Init(const WChannel< Data_t > &chan)'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a05e8434e8fb9a28f20c6be5e836cb39a',1,'WSTM::WReadOnlyChannel::Init(const WChannel< Data_t > &chan, WAtomic &at)'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a8310dab43cb03c9c76ffade44924850c',1,'WSTM::WReadOnlyChannel::Init(const WReadOnlyChannel &chan)'],['../class_w_s_t_m_1_1_w_read_only_channel.html#af11fef99dcf97ec0f1482bfe04cef5de',1,'WSTM::WReadOnlyChannel::Init(const WReadOnlyChannel &chan, WAtomic &at)'],['../class_w_s_t_m_1_1_w_channel_writer.html#a1107e3c7cb809f280e7d2537ff4d201b',1,'WSTM::WChannelWriter::Init()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a34eca1086f535ae69ced876dffb2f8f8',1,'WSTM::WChannelReader::Init(const WChannel< Data > &ch)'],['../class_w_s_t_m_1_1_w_channel_reader.html#a9659a4e588a67fa4c38d74ea2730e768',1,'WSTM::WChannelReader::Init(const WChannel< Data > &ch, WAtomic &at)'],['../class_w_s_t_m_1_1_w_channel_reader.html#ae75d13e1963d7601239f0ff7a1277ece',1,'WSTM::WChannelReader::Init(const WReadOnlyChannel< Data > &ch)'],['../class_w_s_t_m_1_1_w_channel_reader.html#a60a9518b7dc0d6074cb6efb0a9a2a6d4',1,'WSTM::WChannelReader::Init(const WReadOnlyChannel< Data > &ch, WAtomic &at)'],['../class_w_s_t_m_1_1_w_deferred_result.html#ab40f26522863fa54163b1823ec07ef0c',1,'WSTM::WDeferredResult::Init()']]],
7 | ['insert',['insert',['../class_w_s_t_m_1_1_w_persistent_list.html#a605c2f376aff034644215cdc645a0791',1,'WSTM::WPersistentList::insert(const iterator &pos, param_type value)'],['../class_w_s_t_m_1_1_w_persistent_list.html#a77f9d30e17f00b930440940d7841137e',1,'WSTM::WPersistentList::insert(const iterator &pos, Iter_t it, Iter_t end_)']]],
8 | ['isdone',['IsDone',['../class_w_s_t_m_1_1_w_deferred_value_base.html#a8f51bd1013891d3443c524fa01ee62f7',1,'WSTM::WDeferredValueBase::IsDone() const '],['../class_w_s_t_m_1_1_w_deferred_value_base.html#a59ce17bad6e290510b667b9941596db4',1,'WSTM::WDeferredValueBase::IsDone(WAtomic &at) const '],['../class_w_s_t_m_1_1_w_deferred_result.html#afe33ad75fbddd79915a4b696b4652b30',1,'WSTM::WDeferredResult::IsDone() const '],['../class_w_s_t_m_1_1_w_deferred_result.html#a3b9fe5ddaf074318de7bfc9291a7775a',1,'WSTM::WDeferredResult::IsDone(WAtomic &at) const ']]],
9 | ['isreadlocked',['IsReadLocked',['../class_w_s_t_m_1_1_w_atomic.html#a69f9dd57bbd073af0bed993da4771a61',1,'WSTM::WAtomic::IsReadLocked()'],['../class_w_s_t_m_1_1_w_inconsistent.html#ad44a9c8381c2d5b2e3e3369d1e27dd42',1,'WSTM::WInconsistent::IsReadLocked()']]],
10 | ['isunlimited',['IsUnlimited',['../struct_w_s_t_m_1_1_w_time_arg.html#ae579201bba0dcad64d987d71db5a74da',1,'WSTM::WTimeArg']]],
11 | ['isvalid',['IsValid',['../class_w_s_t_m_1_1_w_deferred_result.html#afc610a2bb1e5568cedb1e22e468b3862',1,'WSTM::WDeferredResult']]],
12 | ['iter',['iter',['../class_w_s_t_m_1_1_w_persistent_list_1_1iter.html',1,'WSTM::WPersistentList']]],
13 | ['iterator',['iterator',['../class_w_s_t_m_1_1_w_persistent_list.html#a8c65b601f6837b5e939766138da41bb1',1,'WSTM::WPersistentList']]]
14 | ];
15 |
--------------------------------------------------------------------------------
/doc/ref/html/search/functions_a.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['ondone',['OnDone',['../class_w_s_t_m_1_1_w_deferred_result.html#a8d3eeb1ed09e252bf01a16bcac9b6693',1,'WSTM::WDeferredResult::OnDone(DoneCallback callback)'],['../class_w_s_t_m_1_1_w_deferred_result.html#a828dae8a862bdf0440814e562c434ef6',1,'WSTM::WDeferredResult::OnDone(DoneCallback callback, WAtomic &at)']]],
4 | ['onfail',['OnFail',['../class_w_s_t_m_1_1_w_atomic.html#a5fdbb4d00d707479b59194ff1ebabafe',1,'WSTM::WAtomic']]],
5 | ['operator_20bool',['operator bool',['../class_w_s_t_m_1_1_w_read_only_channel.html#a84d06a0e61534f062d2172b10897dcbd',1,'WSTM::WReadOnlyChannel::operator bool()'],['../class_w_s_t_m_1_1_w_channel_writer.html#a7f21fc34c7116c76ba0e2059bb0b4c18',1,'WSTM::WChannelWriter::operator bool()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a93867f10543cedc0eace630bf2d467c9',1,'WSTM::WChannelReader::operator bool()'],['../class_w_s_t_m_1_1_w_deferred_result.html#aa9a70bb551f9bdf44942b64a63fc0560',1,'WSTM::WDeferredResult::operator bool()'],['../class_w_s_t_m_1_1_w_deferred_result_1_1_w_connection.html#a73bc34ff2d0bbf36f56ed4063042f581',1,'WSTM::WDeferredResult::WConnection::operator bool()'],['../class_w_s_t_m_1_1_w_exception_capture.html#a76c67f923c2a8d910bfef98ab6bf27ae',1,'WSTM::WExceptionCapture::operator bool()']]],
6 | ['operator_21_3d',['operator!=',['../class_w_s_t_m_1_1_w_persistent_list.html#a684bd75160de591a735ab41b755015bf',1,'WSTM::WPersistentList']]],
7 | ['operator_2b',['operator+',['../group___persist_list.html#ga5ea8b838e1d74c3618ce4d23daf3968e',1,'WSTM']]],
8 | ['operator_3c',['operator<',['../struct_w_s_t_m_1_1_w_time_arg.html#a0f780585e0f9e1126453e5675b0055e9',1,'WSTM::WTimeArg']]],
9 | ['operator_3d',['operator=',['../class_w_s_t_m_1_1_w_channel.html#a080a7ef123fd63de2c90830ebb39e1d4',1,'WSTM::WChannel::operator=()'],['../class_w_s_t_m_1_1_w_read_only_channel.html#a89169c9d91bf50be56413b2bd53aec12',1,'WSTM::WReadOnlyChannel::operator=()'],['../class_w_s_t_m_1_1_w_channel_writer.html#a1479564e4c2d96522d355f41a1a204c1',1,'WSTM::WChannelWriter::operator=()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a6cc72f7d909a41ea8459400143596db5',1,'WSTM::WChannelReader::operator=(WChannelReader &&c)'],['../class_w_s_t_m_1_1_w_channel_reader.html#a69abd651fcadd5861be3e630f3ae460c',1,'WSTM::WChannelReader::operator=(const WChannelReader &reader)'],['../class_w_s_t_m_1_1_w_deferred_value.html#a10e6843efbbb55e2ff9cf496bb5a0b0c',1,'WSTM::WDeferredValue::operator=()'],['../class_w_s_t_m_1_1_w_deferred_value_3_01void_01_4.html#a4c7f24161b03f8652366b185522a81e9',1,'WSTM::WDeferredValue< void >::operator=()'],['../class_w_s_t_m_1_1_w_deferred_result.html#aa63f5c35fddce4f4ff1ea988d88ffb59',1,'WSTM::WDeferredResult::operator=(const WDeferredResult &result)'],['../class_w_s_t_m_1_1_w_deferred_result.html#a709e1a4d997f44fe4f17b961eed2794e',1,'WSTM::WDeferredResult::operator=(const WDeferredValue< Result_t > &value)'],['../class_w_s_t_m_1_1_w_exception_capture.html#a2d45c7f33d9851831779ed10aa591180',1,'WSTM::WExceptionCapture::operator=(const WExceptionCapture &exc)'],['../class_w_s_t_m_1_1_w_exception_capture.html#adddaa91bc5b20d482e1499c0eab5829b',1,'WSTM::WExceptionCapture::operator=(WExceptionCapture &&exc)'],['../class_w_s_t_m_1_1_w_read_lock_guard.html#aec648e2a5693a19d764b85172eb1c097',1,'WSTM::WReadLockGuard::operator=()'],['../class_w_s_t_m_1_1_w_var.html#a7a17525bef0d73b3a6c7cd3b9aa865ec',1,'WSTM::WVar::operator=(const WVar &)=delete'],['../class_w_s_t_m_1_1_w_var.html#a3179fcc33e786ad0018fd251f7127223',1,'WSTM::WVar::operator=(WVar &&var)'],['../class_w_s_t_m_1_1_w_transaction_local_value.html#af9b96def4cb1126e9d9a40a8577b0efd',1,'WSTM::WTransactionLocalValue::operator=()']]],
10 | ['operator_3d_3d',['operator==',['../class_w_s_t_m_1_1_w_persistent_list.html#aa7e71c671f98d5b56cc7185518dcd0d5',1,'WSTM::WPersistentList']]]
11 | ];
12 |
--------------------------------------------------------------------------------
/src/exception_capture.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #include "exception_capture.h"
32 |
33 | namespace WSTM
34 | {
35 | WExceptionCapture::WExceptionCapture ()
36 | {}
37 |
38 | WExceptionCapture::WExceptionCapture (const WExceptionCapture& exc):
39 | m_thrower_v (exc.m_thrower_v.GetReadOnly ())
40 | {}
41 |
42 | WExceptionCapture& WExceptionCapture::operator= (const WExceptionCapture& exc)
43 | {
44 | Atomically ([&](WAtomic& at)
45 | {
46 | m_thrower_v.Set (exc.m_thrower_v.Get(at), at);
47 | });
48 | return *this;
49 | }
50 |
51 | WExceptionCapture::WExceptionCapture (WExceptionCapture&& exc):
52 | m_thrower_v (std::move (exc.m_thrower_v))
53 | {}
54 |
55 | WExceptionCapture& WExceptionCapture::operator= (WExceptionCapture&& exc)
56 | {
57 | m_thrower_v = std::move (exc.m_thrower_v);
58 | return *this;
59 | }
60 |
61 | void WExceptionCapture::Capture (const WExceptionCapture& exc)
62 | {
63 | Atomically ([&](WAtomic& at){Capture (exc, at);});
64 | }
65 |
66 | void WExceptionCapture::Capture (const WExceptionCapture& exc, WAtomic& at)
67 | {
68 | m_thrower_v.Set (exc.m_thrower_v.Get (at), at);
69 | }
70 |
71 | void WExceptionCapture::Reset ()
72 | {
73 | m_thrower_v.Set (Thrower ());
74 | }
75 |
76 | void WExceptionCapture::Reset (WAtomic& at)
77 | {
78 | m_thrower_v.Set (Thrower (), at);
79 | }
80 |
81 | void WExceptionCapture::ThrowCaptured () const
82 | {
83 | Atomically ([&](WAtomic& at){ThrowCaptured (at);});
84 | }
85 |
86 | void WExceptionCapture::ThrowCaptured (WAtomic& at) const
87 | {
88 | Thrower thrower = m_thrower_v.Get (at);
89 | if (thrower)
90 | {
91 | thrower ();
92 | }
93 | }
94 |
95 | WExceptionCapture::operator bool () const
96 | {
97 | return bool (m_thrower_v.GetReadOnly ());
98 | }
99 |
100 | bool WExceptionCapture::HasCaptured(WAtomic& at) const
101 | {
102 | return bool (m_thrower_v.Get (at));
103 | }
104 |
105 | }
106 |
--------------------------------------------------------------------------------
/doc/ref/html/search/all_e.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['rbegin',['rbegin',['../class_w_s_t_m_1_1_w_persistent_list.html#a86a8759302de29b1c299893e0f6444da',1,'WSTM::WPersistentList::rbegin()'],['../class_w_s_t_m_1_1_w_persistent_list.html#a3b3eb51429e4c070c12f934634c37dd9',1,'WSTM::WPersistentList::rbegin() const ']]],
4 | ['read',['Read',['../class_w_s_t_m_1_1_w_channel_reader.html#a49d89009bd830a19b4b1c59b6911ff2d',1,'WSTM::WChannelReader']]],
5 | ['readall',['ReadAll',['../class_w_s_t_m_1_1_w_channel_reader.html#aaaa258752cb47ebb4cece3fe2ebcc3e6',1,'WSTM::WChannelReader::ReadAll()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a44bfcb71d9e4608c452b3880b2456aba',1,'WSTM::WChannelReader::ReadAll(WAtomic &at)']]],
6 | ['readatomic',['ReadAtomic',['../class_w_s_t_m_1_1_w_channel_reader.html#a797752117acedad3726b06a110f2656e',1,'WSTM::WChannelReader']]],
7 | ['readlock',['ReadLock',['../class_w_s_t_m_1_1_w_atomic.html#a8037cf1cff612bfd2c244ee57d2da3e4',1,'WSTM::WAtomic::ReadLock()'],['../class_w_s_t_m_1_1_w_inconsistent.html#aef5ebab3acb1685a81607a7972da282f',1,'WSTM::WInconsistent::ReadLock()']]],
8 | ['readretry',['ReadRetry',['../class_w_s_t_m_1_1_w_channel_reader.html#ac401ab38adce4236ce0f7627b07561fc',1,'WSTM::WChannelReader']]],
9 | ['readunlock',['ReadUnlock',['../class_w_s_t_m_1_1_w_atomic.html#a2d3a41a852d05b5518da535b0e725718',1,'WSTM::WAtomic::ReadUnlock()'],['../class_w_s_t_m_1_1_w_inconsistent.html#ad29b5ddcd6a7327149ef6595fbd37166',1,'WSTM::WInconsistent::ReadUnlock()']]],
10 | ['release',['Release',['../class_w_s_t_m_1_1_w_read_only_channel.html#a70e94e75dfed945f3ed349a4794f52d7',1,'WSTM::WReadOnlyChannel::Release()'],['../class_w_s_t_m_1_1_w_read_only_channel.html#aff402f24cfa6cda54b4353fbd0595e93',1,'WSTM::WReadOnlyChannel::Release(WAtomic &at)'],['../class_w_s_t_m_1_1_w_channel_writer.html#af57c7141ccb9f2cc5656b8be10ff0980',1,'WSTM::WChannelWriter::Release()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a85295e6a8345f62fef2e174907a9de94',1,'WSTM::WChannelReader::Release()'],['../class_w_s_t_m_1_1_w_channel_reader.html#a214da37d360303c51143019c72bfe96a',1,'WSTM::WChannelReader::Release(WAtomic &at)'],['../class_w_s_t_m_1_1_w_deferred_result.html#a487d5b6d4e848b7defcd4b42bce6f0db',1,'WSTM::WDeferredResult::Release()'],['../class_w_s_t_m_1_1_w_deferred_result.html#aab28ddd888cb6ce131854a64eb415eac',1,'WSTM::WDeferredResult::Release(WAtomic &at)']]],
11 | ['rend',['rend',['../class_w_s_t_m_1_1_w_persistent_list.html#a42ae2f7b96f12b97bd64d755552ad96b',1,'WSTM::WPersistentList::rend()'],['../class_w_s_t_m_1_1_w_persistent_list.html#a5834a5f8f4f6f782697b2354d4a9aef9',1,'WSTM::WPersistentList::rend() const ']]],
12 | ['replace',['replace',['../class_w_s_t_m_1_1_w_persistent_list.html#a9cf0f5b7982529fcb64765aec1c1500c',1,'WSTM::WPersistentList']]],
13 | ['reset',['Reset',['../class_w_s_t_m_1_1_w_exception_capture.html#afc3273d57ea64148043d6d8d21e0868e',1,'WSTM::WExceptionCapture::Reset()'],['../class_w_s_t_m_1_1_w_exception_capture.html#a48da3b0d6ff26549e7fef106eac31b5f',1,'WSTM::WExceptionCapture::Reset(WAtomic &at)']]],
14 | ['retry',['Retry',['../group___core.html#gac553425cfd41fcf60669313f91a162a3',1,'WSTM']]],
15 | ['retryifempty',['RetryIfEmpty',['../class_w_s_t_m_1_1_w_channel_reader.html#a4f8b7c5cadf15ce0f0471f9c7d26d4c0',1,'WSTM::WChannelReader']]],
16 | ['retryifnotdone',['RetryIfNotDone',['../class_w_s_t_m_1_1_w_deferred_result.html#a89f27627f46978be189c06584e1a300c',1,'WSTM::WDeferredResult']]],
17 | ['reverse_5fiterator',['reverse_iterator',['../class_w_s_t_m_1_1_w_persistent_list.html#a29416d3794e9d6425bb94b09845ea9fd',1,'WSTM::WPersistentList']]],
18 | ['run_5flocked',['RUN_LOCKED',['../struct_w_s_t_m_1_1_w_conflict_resolution.html#a51c258e38488251484ab282cb5e963abab66c5db4c2d5f2fc7a56f34862b4ca0f',1,'WSTM::WConflictResolution']]],
19 | ['runatomically',['RunAtomically',['../group___core.html#ga79f61cd02ad11aea2a826075c1f44500',1,'WSTM']]]
20 | ];
21 |
--------------------------------------------------------------------------------
/doc/ref/html/dynsections.js:
--------------------------------------------------------------------------------
1 | function toggleVisibility(linkObj)
2 | {
3 | var base = $(linkObj).attr('id');
4 | var summary = $('#'+base+'-summary');
5 | var content = $('#'+base+'-content');
6 | var trigger = $('#'+base+'-trigger');
7 | var src=$(trigger).attr('src');
8 | if (content.is(':visible')===true) {
9 | content.hide();
10 | summary.show();
11 | $(linkObj).addClass('closed').removeClass('opened');
12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
13 | } else {
14 | content.show();
15 | summary.hide();
16 | $(linkObj).removeClass('closed').addClass('opened');
17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
18 | }
19 | return false;
20 | }
21 |
22 | function updateStripes()
23 | {
24 | $('table.directory tr').
25 | removeClass('even').filter(':visible:even').addClass('even');
26 | }
27 |
28 | function toggleLevel(level)
29 | {
30 | $('table.directory tr').each(function() {
31 | var l = this.id.split('_').length-1;
32 | var i = $('#img'+this.id.substring(3));
33 | var a = $('#arr'+this.id.substring(3));
34 | if (l
2 |
3 |
4 |
5 |
6 |
7 | Wyatt-STM: Main Page
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
Wyatt-STM
27 | 1.0.0
28 |
29 |
Software transactional memory system developed at Wyatt Technology
86 |
87 |
88 | Generated by
89 |
90 | 1.8.10
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/src/channel.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #include "channel.h"
32 |
33 | namespace WSTM
34 | {
35 | WChannelError::WChannelError (const std::string& msg):
36 | WException (msg)
37 | {}
38 |
39 | WInvalidChannelError::WInvalidChannelError():
40 | WChannelError("Attempt to use an invalid channel")
41 | {}
42 |
43 | namespace Internal
44 | {
45 | #ifdef WATCH_MEMORY
46 | namespace
47 | {
48 | int s_numNodes = 0;
49 | std::mutex s_numNodesMutex;
50 | size_t s_nodeNum = 1;
51 | using NodeMap = std::map;
52 | NodeMap s_nodeNums;
53 | }
54 |
55 | void IncrementNumNodes (WChannelCoreNodeBase* node_p)
56 | {
57 | std::lock_guard lock (s_numNodesMutex);
58 | ++s_numNodes;
59 | s_nodeNums[node_p] = s_nodeNum;
60 | ++s_nodeNum;
61 | }
62 |
63 | void DecrementNumNodes (WChannelCoreNodeBase* node_p)
64 | {
65 | std::lock_guard lock (s_numNodesMutex);
66 | --s_numNodes;
67 | assert (s_numNodes >= 0);
68 | s_nodeNums[node_p] = 0;
69 | }
70 |
71 | int GetNumNodes ()
72 | {
73 | std::lock_guard lock (s_numNodesMutex);
74 | return s_numNodes;
75 | }
76 |
77 | std::vector GetExistingNodeNums ()
78 | {
79 | std::lock_guard lock (s_numNodesMutex);
80 | std::vector nums;
81 | for (const auto& val: s_nodeNums)
82 | {
83 | if (val.second > 0)
84 | {
85 | nums.push_back (val.second);
86 | }
87 | }
88 | return nums;
89 | }
90 |
91 | size_t GetMaxNodeNum ()
92 | {
93 | std::lock_guard lock (s_numNodesMutex);
94 | return s_nodeNum;
95 | }
96 |
97 | #else //WATCH_MEMORY
98 |
99 | void IncrementNumNodes (WChannelCoreNodeBase*)
100 | {}
101 |
102 | void DecrementNumNodes (WChannelCoreNodeBase*)
103 | {}
104 |
105 | int GetNumNodes ()
106 | {
107 | return 0;
108 | }
109 |
110 | std::vector GetExistingNodeNums ()
111 | {
112 | return std::vector();
113 | }
114 |
115 | size_t GetMaxNodeNum ()
116 | {
117 | return 0;
118 | }
119 |
120 | #endif //WATCH_MEMORY
121 | }
122 |
123 | }
124 |
--------------------------------------------------------------------------------
/wstm/find_arg.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015, Wyatt Technology Corporation
2 | // All rights reserved.
3 |
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 |
8 | // 1. Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 |
11 | // 2. Redistributions in binary form must reproduce the above copyright
12 | // notice, this list of conditions and the following disclaimer in the
13 | // documentation and/or other materials provided with the distribution.
14 |
15 | // 3. Neither the name of the copyright holder nor the names of its
16 | // contributors may be used to endorse or promote products derived from
17 | // this software without specific prior written permission.
18 |
19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | #include
32 |
33 |
34 | /**
35 | * @file find_arg.h
36 | * A system for finding specific types in a parameter pack.
37 | */
38 |
39 | namespace WSTM
40 | {
41 | /**
42 | * @defgroup FindArg Argument Finder
43 | *
44 | * Finds arguments of a given type in a parameter pack.
45 | */
46 | ///@{
47 |
48 | //@{
49 | /**
50 | * Finds the given type in the given pack of arguments. This is useful for having variadic
51 | * argument lists for functions. To have variadic arguments in a function just make the function
52 | * a template and take a parameter pack of arguments. Then use findArg to find any given type in
53 | * the parameter pack (each argument you want to be able to find needs to have a unique type,
54 | * which is easy to arrange by using the FIND_ARG__MAKE_ARG_TYPE macro). findArg will return the
55 | * argument of the given type or a default constructed object of the given type if there was no
56 | * object of the given type in the argument pack.
57 | *
58 | * @param Wanted_t The type to find.
59 | * @param as The arguments to search through.
60 | */
61 | template
62 | std::enable_if_t::value, Wanted_t> findArg (const A_t& a, const As_t&...)
63 | {
64 | return a;
65 | }
66 |
67 | template
68 | std::enable_if_t::value, Wanted_t> findArg (const A_t&, const As_t&... as)
69 | {
70 | return findArg (as...);
71 | }
72 |
73 | template
74 | std::enable_if_t::value, Wanted_t> findArg (const A_t& a)
75 | {
76 | return a;
77 | }
78 |
79 | template
80 | std::enable_if_t::value, Wanted_t> findArg (const A_t&)
81 | {
82 | return Wanted_t ();
83 | }
84 |
85 | template
86 | Wanted_t findArg ()
87 | {
88 | return Wanted_t ();
89 | }
90 | //@}
91 |
92 | /**
93 | * Creates a type for use with findArg. The created type will have a "m_value" member that
94 | * contains the actual value for the argument.
95 | *
96 | * @param type The type for m_value.
97 | * @param name The name that shoudl be given to the create type.
98 | * @param def The default value for m_value.
99 | */
100 | #define FIND_ARG__MAKE_ARG_TYPE(type, name, def) \
101 | struct name \
102 | { \
103 | type m_value; \
104 | name () : m_value (def) {} \
105 | name (const type value) : m_value (value) {} \
106 | };//
107 |
108 | ///@}
109 | }
110 |
--------------------------------------------------------------------------------
/doc/ref/html/namespacemembers_vars.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Wyatt-STM: Namespace Members
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
Wyatt-STM
27 | 1.0.0
28 |
29 |
Software transactional memory system developed at Wyatt Technology