In this article I’ll tell you about my pure functional library for Software Transactional Memory (STM) that I’ve built in C++. I adopted some advanced functional programming concepts that make it composable and convenient to use. Its implementation is rather small and robust, which differentiates the library from competitors. Let’s discuss what STM is and how to use it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2022 DeepMind Technologies Limited. | |
| # Licensed under the Apache License, Version 2.0 and CC BY 4.0. | |
| # You may not use this file except in compliance with these licenses. | |
| # Copies of the licenses can be found at https://www.apache.org/licenses/LICENSE-2.0 | |
| # and https://creativecommons.org/licenses/by/4.0/legalcode. | |
| """Pseudocode description of the Stochastic MuZero algorithm. | |
| This pseudocode was adapted from the original MuZero pseudocode. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2022 DeepMind Technologies Limited. | |
| # Licensed under the Apache License, Version 2.0 and CC BY 4.0. | |
| # You may not use this file except in compliance with these licenses. | |
| # Copies of the licenses can be found at https://www.apache.org/licenses/LICENSE-2.0 | |
| # and https://creativecommons.org/licenses/by/4.0/legalcode. | |
| """Pseudocode description of the MuZero Unplugged algorithm.""" | |
| # pylint: disable=unused-argument | |
| # pylint: disable=missing-docstring | |
| # pylint: disable=g-explicit-length-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2022 DeepMind Technologies Limited. | |
| # Licensed under the Apache License, Version 2.0 and CC BY 4.0. | |
| # You may not use this file except in compliance with these licenses. | |
| # Copies of the licenses can be found at https://www.apache.org/licenses/LICENSE-2.0 | |
| # and https://creativecommons.org/licenses/by/4.0/legalcode. | |
| """Pseudocode description of the MuZero algorithm.""" | |
| # pylint: disable=unused-argument | |
| # pylint: disable=missing-docstring | |
| # pylint: disable=g-explicit-length-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ | |
| │vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ | |
| ╞══════════════════════════════════════════════════════════════════════════════╡ | |
| │ Copyright 2022 Justine Alexandra Roberts Tunney │ | |
| │ │ | |
| │ Permission to use, copy, modify, and/or distribute this software for │ | |
| │ any purpose with or without fee is hereby granted, provided that the │ | |
| │ above copyright notice and this permission notice appear in all copies. │ | |
| │ │ | |
| │ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copyright 2020 Morgan McGuire & Mara Gagiu. | |
| Provided under the Open Source MIT license https://opensource.org/licenses/MIT | |
| by Morgan McGuire and Mara Gagiu. | |
| */ | |
| /*============================================================================= | |
| ReShade 4 effect file | |
| github.com/martymcmodding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ColorSchemes | |
| using Dates | |
| using Images | |
| using Printf | |
| using SIMD | |
| const palette = RGB{Float32}.(colorschemes[:inferno].colors) | |
| const n_colors = length(palette) | |
| const black = RGB{Float32}(0, 0, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ColorSchemes | |
| using Dates | |
| using Images | |
| using Printf | |
| colors = RGB{Float32}.(colorschemes[:inferno].colors) | |
| n_colors = length(colors) | |
| black = RGB{Float32}(0, 0, 0) | |
| function interpolate_color(n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This library is free software; you can redistribute it and/or | |
| // modify it under the terms of the GNU Lesser General Public | |
| // License as published by the Free Software Foundation; either | |
| // version 3.0 of the License, or (at your option) any later version. | |
| // | |
| // This library is distributed in the hope that it will be useful, | |
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| // Lesser General Public License for more details. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3.5 | |
| # Author: Dagang Wei (github.com/weidagang) | |
| # Created: 2016-11-19 | |
| # Last modified: 2016-11-27 | |
| # License: MIT | |
| # Self link: https://gist.github.com/weidagang/1b001d0e55c4eff15ad34cc469fafb84 | |
| # | |
| # This code demonstrates the core algorithm for distributed MVCC based cross-row | |
| # transactions. The algorithm is built on top of a distributed key-value database |
NewerOlder