Code Sample

How to printf inside (aborted) Intel® Transactional Synchronization Extensions (Intel TSX) transactions

One of the most popular ad-hoc functional debugging techniques is to use the printf or fprintf functions to display the state of variables. However, if these functions are used inside an Intel® TSX transaction they can cause transaction aborts. The reason is that flushing the print output buffer involves an operating system call and an I/O operation: operations that cannot be roll backed by Intel® TSX. That means that the (f)printf output from transaction may be lost due to the machine state roll-back as a result of the transaction abort caused by the attempt to flush the I/O buffer inside the transaction. If the flush happens after a committed transaction then the printf output won’t be lost. In general, any transaction abort handler needs to use a fall-back synchronization mechanism that does not involve Intel TSX. It should, therefore, be possible to see the problem that is being debugged there where printf works as expected. However, what can you do if, for some reason, the problem is not reproducible in the fall-back execution? So far I haven’t had this problem, but if you do please consider the trick shown below.

Отслеживание лица с помощью JavaScript* и Intel® RealSense™ SDK

This article shows how to use the Intel RealSense SDK's face tracking functionality to gather the bounding box and nose point data of a user, for potential control and/or in-game avatar application (for example, using the nose to target, the player’s head essentially becomes the joystick, or having the player’s character in-game reflect their movement capitalizes on the atypical interface to create an engaging environment). Includes a code sample!
  • Microsoft Windows* 10
  • Microsoft Windows* 8.x
  • Intel® RealSense™ Technology
  • JavaScript*
  • Beginner
  • Intel® RealSense™ SDK
  • Intel® RealSense™ Technology
  • face tracking
  • depth camera
  • API without Secrets: Introduction to Vulkan* Part 4

    This tutorial presents how to add vertex attributes to a graphics pipeline and how to create vertex buffers and bind them during command buffer recording. It teaches how to create memory objects that backs buffer storage, and how map them to upload data from the CPU to the GPU. Here also dynamic pipeline states for the viewport and scissors test are introduced.
  • Linux*
  • Microsoft Windows* 10
  • Microsoft Windows* 8.x
  • Game Development
  • Windows*
  • C/C++
  • Beginner
  • Intermediate
  • vulkan
  • Vulkan API
  • api
  • render pass
  • framebuffers
  • graphics pipeline
  • Viewport
  • rasterization
  • multisampling
  • command pool
  • Command Buffers
  • vertex attributes
  • vertex buffer
  • OpenGL*
  • Game Development
  • Graphics
  • Rendering
  • Implementing User Experience Guidelines in Intel® RealSense™ Applications

    In this article, we cover an application that was developed for the use of Intel® RealSense™ application developers to help visualize UX requirements and implement these guidelines in code. The source code for the application is available for download through this article.
  • Microsoft Windows* 10
  • Microsoft Windows* 8.x
  • Intel® RealSense™ Technology
  • Windows*
  • C#
  • C/C++
  • Intel® RealSense™ SDK
  • Intel® RealSense™ Technology
  • Microsoft DirectX*
  • Intel® Quark™ Microcontroller Developer Kit D2000 Accelerometer and PWM: Lab Guide

    The purpose of this lab is to show how to program the Intel® Quark™ Microcontroller D2000 PWM module and Bosch* BMC150 accelerometer integrated in the Intel® Quark™ Microcontroller Developer Kit D2000 board, using Quark Microcontroller Software Interface (QMSI) and Intel® System Studio 2016 for Microcontrollers.
  • Internet of Things
  • Tutorial on Intel® Xeon Phi™ Processor Optimization

    Download File [TAR 20KB]

    1. Introduction

    In this tutorial, we demonstrate some possible ways to optimize an application to run on the Intel® Xeon Phi™ processor. The optimization process in this tutorial is divided into three parts:

  • Professional
  • Professors
  • Students
  • Modern Code
  • Intel® Many Integrated Core Architecture
  • Recipe: The Black-Scholes-Merton Formula Optimization for Intel® Xeon Phi™ Processor

    Financial derivative pricing is a cornerstone of quantitative finance. The most common form of financial derivatives is common stock options, which are contracts between two parties regarding buying or selling an asset (specifically shares of stock) at a certain time at an agreed price.
  • Modern Code
  • Intel® Many Integrated Core Architecture
  • Subscribe to Code Sample