Hi Jens --

Without knowing much about the TSX interface, here's a very high-level 
potential sketch:

* write some C macros that wrap the start/end transaction instructions and look 
like function calls syntactically.
     e.g.:
       #define CHPL_TSX_START (<whatever magic starts the transaction via C>)
       #define CHPL_TSX_STOP(<whatever magic stops the transaction via C>)

* declare these C macros as extern procs within an internal Chapel module
     e.g.:
       extern proc CHPL_TSX_START()
       extern proc CHPL_TSX_STOP()

* in the parser, insert "calls" to these external routines as the first and 
last statements of the block created when parsing an atomic block (in 
buildAtomicStmt()).

    e.g.:
       STMT* atomicBlock = new BlockStmt(stmt);
       atomicBlock->insertAtHead(new CallExpr("CHPL_TSX_START"));
       atomicBlock->insertAtTail(new CallExpr("CHPL_TSX_STOP"));


-Brad




________________________________
From: Jens Breitbart [[email protected]]
Sent: Tuesday, March 25, 2014 4:10 AM
To: Chapel Sourceforge Developers List
Subject: [Chapel-developers] Atomic statement @ Intel Haswell

Hi all,

I would like to make some small experiments with the atomic statement and I am 
looking for pointers on how to implement the atomic statement, if hardware 
transactional memory is available. Intel's TSX provides instructions to 
start/end an transactions, so what I am looking for is to execute the 
instructions that start a transaction at the beginning of the atomic statement 
and the ones the end the transaction at the end of the statement. Anyone has an 
idea on how to do that?

I have been poking around in the source code and I know there is an an old 
version implementing software transactional memory, but I am not sure if there 
is really any benefit from working with this version.

I am aware, that an implementation based on TSX will only work for a single 
locale, but I am fine with that.

-Jens
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to