A Multithreaded, Transaction-Based Locking Strategy for Containers
variable • Atomic pointer • Atomic compare and exchange • Need a class that represents a lockable item (element) • Need a class that manages transactions on behalf of each thread • Transactions are represented Transaction ID using item_id_type = uint64_t; //- Item ID class transaction_manager; class lockable_item; class stopwatch;Copyright © 2020 Bob Steagall Class lockable_item 43 CppCon 2020 - A Multi-threaded Transaction-Based Locking Strategy for Containers Class Overview – lockable_item class lockable_item { public: lockable_item(); item_id_type id() const noexcept; tsv_type last_tsv() const noexcept; private:0 码力 | 142 页 | 474.78 KB | 5 月前3Game Development for Human Beings
you’ll see a dialog where you can enter properties. Enter a property called “type” with value “item” to the tea cups (this is not the “type” select dropdown!, this is within the Properties area), “playerStart” = this.game.add.group(); 29 this.items.enableBody = true; 30 var item; 31 result = this.findObjectsByType('item', this.map, 'objectsLayer'); 32 result.forEach(function(element){ 33 ShootingItem, that will give the player the ability to attack. First, we will create a generic Item prefab to reunite the common code between both items. All items will have an immovable physics body0 码力 | 472 页 | 8.46 MB | 10 月前3Writing Python Bindings for C++ Libraries: Easy-to-use Performance
compiled with clang++12 -fPIC -O3Some perf numbers: per increment runtime https://news.ycombinator.com/item?id=34663930 Out in the wild case of noticing high overheads in pysimdjson (they switched from pybind11 print("Row " + str(i) + " is " + str(row)) for item in row.items(): print(" - {}:{}".format(reader.getIdName(item.id), item.value()))Working example $ python3 python/v1.py Number print("Row " + str(i) + " is " + str(row)) for item in row.items(): print(" - {}:{}".format(reader.getIdName(item.id), item.value()))Reader code class RowReader : public BinaryListener0 码力 | 118 页 | 2.18 MB | 5 月前3Django CMS 4.1.x Documentation
an error instead. After each of the steps below run cms check to verify that you have resolved that item in its checklist. Adding content-handling functionality MEDIA_URL = "/media/" MEDIA_ROOT = os.path have your new cms_toolbars.py file recognised. You will now find, in every page of the site, a new item in the toolbar: from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool what gets called when the toolbar is built. In it, we’re using get_or_create_menu() to add a Polls item to the toolbar. Add nodes to the Polls menu So far, the Polls menu is empty. We can extend populate()0 码力 | 518 页 | 1.66 MB | 6 月前3Django CMS 4.0.x Documentation
every page of the site, a new item in the toolbar: The populate() method is what gets called when the toolbar is built. In it, we’re using get_or_create_menu() to add a Polls item to the toolbar. 22 Chapter manipulate, so let’s change the populate() method to add an item that allows us to see the full list of polls in the sideframe, with add_sideframe_item(). from cms.utils.urlutils import admin_reverse [...] class get_or_create_menu('polls_cms_integration-polls', 'Polls') menu.add_sideframe_item( name='Poll list', # name of the new menu item url=admin_reverse('polls_poll_changelist'), # the URL it should open with )0 码力 | 296 页 | 1.79 MB | 6 月前3Django CMS 3.9.x Documentation
every page of the site, a new item in the toolbar: The populate() method is what gets called when the toolbar is built. In it, we’re using get_or_create_menu() to add a Polls item to the toolbar. Add nodes manipulate, so let’s change the populate() method to add an item that allows us to see the full list of polls in the sideframe, with add_sideframe_item(). from cms.utils.urlutils import admin_reverse [...] class get_or_create_menu('polls_cms_integration-polls', 'Polls') menu.add_sideframe_item( name='Poll list', # name of the new menu item url=admin_reverse('polls_poll_changelist'), # the URL it should open with )0 码力 | 298 页 | 1.79 MB | 6 月前3Django CMS 3.9.x Documentation
page of the site, a new item in the toolbar: The populate() method is what gets called when the toolbar is built. In it, we’re using get_or_create_menu() to add a Polls item to the toolbar. 6.1.1.1. manipulate, so let’s change the populate() method to add an item that allows us to see the full list of polls in the sideframe, with add_sideframe_item(). from cms.utils.urlutils import admin_reverse [...] gration- polls', 'Polls') menu.add_sideframe_item( name='Poll list', # name of the new menu item url=admin_reverse('polls_poll_changelist')0 码力 | 417 页 | 1.68 MB | 6 月前3Django CMS 3.8.x Documentation
page of the site, a new item in the toolbar: The populate() method is what gets called when the toolbar is built. In it, we’re using get_or_create_menu() to add a Polls item to the toolbar. 6.1.1.1. manipulate, so let’s change the populate() method to add an item that allows us to see the full list of polls in the sideframe, with add_sideframe_item(). from cms.utils.urlutils import admin_reverse [...] gration- polls', 'Polls') menu.add_sideframe_item( name='Poll list', # name of the new menu item url=admin_reverse('polls_poll_changelist')0 码力 | 413 页 | 1.67 MB | 6 月前3Django CMS 3.0.x Documentation
get_or_create_menu('poll-app', _('Polls')) url = reverse('admin:polls_poll_changelist') menu.add_sideframe_item(_('Poll overview'), url=url) What we’re doing above is this: • defining a CMSToolbar subclass • registering a populate() method that adds an item to the menu The populate() method: • checks whether we’re in a page belonging to this application • if so, it creates a menu item if one’s not already there • works works out the URL for this menu item 18 Chapter 5. Table of contents django cms Documentation, Release 3.0.19.dev1 • tells it that it should open in the admin sideframe Your cms_toolbar.py file should contain0 码力 | 180 页 | 1.56 MB | 6 月前3Heterogeneous Modern C++ with SYCL 2020
com/2021/02/03/can-sycl-slice-into-broader-supercomputing/ https://www.phoronix.com/scan.php?page=news_item&px=hipSYCL-New-Lite-Runtime https://software.intel.com/content/www/us/en/develop/articles/interop itself The kernel function takes as a parameter an id which represents the currently executing work-item #includeint main(int argc, char *argv[]) { std::vector dA{ … }, dB{ … to a work item ○ Not accessible to other work items ○ Kernel memory ○ Local stack variables ● Work item ○ An instance of a kernel ○ Has a global id Work Item Private Memory Work Item Private Memory 0 码力 | 114 页 | 7.94 MB | 5 月前3
共 180 条
- 1
- 2
- 3
- 4
- 5
- 6
- 18