Changeset 1095

Show
Ignore:
Timestamp:
08/25/06 02:43:26 (2 years ago)
Author:
rossb
Message:

some comment cleanups

Location:
sfio/trunk/src/lockfree
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • sfio/trunk/src/lockfree/grame02_stack.c

    r1094 r1095  
    5151 
    5252 
    53 LIBLF_CALLING_CONVENTION(void) grame02_stack_initialize( grame02_stack_t* stack ) 
     53LIBLFDS_CALLING_CONVENTION(void) grame02_stack_initialize( grame02_stack_t* stack ) 
    5454{ 
    5555    stack->top = 0; 
     
    5757 
    5858 
    59 LIBLF_CALLING_CONVENTION(void) grame02_stack_push( grame02_stack_t* stack, grame02_stack_node_t *node ) 
     59LIBLFDS_CALLING_CONVENTION(void) grame02_stack_push( grame02_stack_t* stack, grame02_stack_node_t *node ) 
    6060{ 
    6161// B1: loop 
     
    7777 
    7878 
    79 LIBLF_CALLING_CONVENTION(grame02_stack_node_t*) grame02_stack_pop( grame02_stack_t* stack ) 
     79LIBLFDS_CALLING_CONVENTION(grame02_stack_node_t*) grame02_stack_pop( grame02_stack_t* stack ) 
    8080{ 
    8181    grame02_stack_node_t *top, *next; 
     
    110110 
    111111 
    112 LIBLF_CALLING_CONVENTION(void) grame02_stack_test(void) 
     112LIBLFDS_CALLING_CONVENTION(void) grame02_stack_test(void) 
    113113{ 
    114114    const char *s = "\n!dlrow olleh"; 
  • sfio/trunk/src/lockfree/grame02_stack.h

    r1094 r1095  
    55    multiple-reader, multiple-writer lock-free LIFO stack 
    66 
    7 D. Fober, S. Letz, Y. Orlarey  
    8 Actes des Journées d'Informatique Musicale JIM2002, Marseille GMEM 2002 Pages 143--150. 
    9 ftp://ftp.grame.fr/pub/Documents/fober-JIM2002.pdf 
     7    D. Fober, S. Letz, Y. Orlarey 
     8    "Lock-Free Techniques for Concurrent Access to Shared Objects," 
     9    Actes des Journées d'Informatique Musicale JIM2002, Marseille GMEM 2002 Pages 143--150. 
     10    ftp://ftp.grame.fr/pub/Documents/fober-JIM2002.pdf 
    1011 
    11 actually i think this is the IBM algorithm, but I havn't found the reference yet 
     12    actually i think this is the IBM freelist algorithm, but I havn't found the reference yet 
    1213*/ 
    1314 
    1415 
    15 #define LIBLF_CALLING_CONVENTION( return_type )  return_type __stdcall 
     16#define LIBLFDS_CALLING_CONVENTION( return_type )  return_type __stdcall 
    1617 
    1718#ifdef __cplusplus 
     
    2122 
    2223 
    23 typedef void* grame02_value_t;     // this is the "payload" data type which is stored in the stack node 
     24typedef void* grame02_value_t;     /* this is the "payload" data type which is stored in the stack node */ 
    2425 
    2526struct grame02_stack_node_t; 
     
    4445 
    4546 
    46 LIBLF_CALLING_CONVENTION(void) grame02_stack_initialize( grame02_stack_t* stack ); 
     47LIBLFDS_CALLING_CONVENTION(void) grame02_stack_initialize( grame02_stack_t* stack ); 
    4748 
    48 LIBLF_CALLING_CONVENTION(void) grame02_stack_push( grame02_stack_t* stack, grame02_stack_node_t *node ); 
     49LIBLFDS_CALLING_CONVENTION(void) grame02_stack_push( grame02_stack_t* stack, grame02_stack_node_t *node ); 
    4950 
    50 LIBLF_CALLING_CONVENTION(grame02_stack_node_t*) grame02_stack_pop( grame02_stack_t* stack ); 
     51LIBLFDS_CALLING_CONVENTION(grame02_stack_node_t*) grame02_stack_pop( grame02_stack_t* stack ); 
    5152 
    52 LIBLF_CALLING_CONVENTION(void) grame02_stack_test(void); 
     53LIBLFDS_CALLING_CONVENTION(void) grame02_stack_test(void); 
    5354 
    5455#ifdef __cplusplus 
  • sfio/trunk/src/lockfree/ms96_queue.c

    r1094 r1095  
    118118 
    119119 
    120 LIBLF_CALLING_CONVENTION(void) ms96_queue_initialize( ms96_queue_t *q, ms96_queue_node_t* node ) 
     120LIBLFDS_CALLING_CONVENTION(void) ms96_queue_initialize( ms96_queue_t *q, ms96_queue_node_t* node ) 
    121121{ 
    122122// node = new node()           # Allocate a free node 
     
    140140 
    141141 
    142 LIBLF_CALLING_CONVENTION(void) ms96_queue_terminate( ms96_queue_t* queue, ms96_queue_node_t** node ) 
     142LIBLFDS_CALLING_CONVENTION(void) ms96_queue_terminate( ms96_queue_t* queue, ms96_queue_node_t** node ) 
    143143{ 
    144144    assert_empty( queue ); 
     
    149149 
    150150// enqueue(Q: pointer to queue t, value: data type) 
    151 LIBLF_CALLING_CONVENTION(void) ms96_queue_enqueue( ms96_queue_t* q, ms96_queue_node_t *node, ms96_value_t value ) 
     151LIBLFDS_CALLING_CONVENTION(void) ms96_queue_enqueue( ms96_queue_t* q, ms96_queue_node_t *node, ms96_value_t value ) 
    152152{ 
    153153    ms96_tagged_node_pointer_t tail; 
     
    210210 
    211211// dequeue(Q: pointer to queue t, pvalue: pointer to data type): boolean 
    212 LIBLF_CALLING_CONVENTION(int) ms96_queue_dequeue( ms96_queue_t* q, ms96_queue_node_t** node, ms96_value_t* value ) 
     212LIBLFDS_CALLING_CONVENTION(int) ms96_queue_dequeue( ms96_queue_t* q, ms96_queue_node_t** node, ms96_value_t* value ) 
    213213{ 
    214214    ms96_tagged_node_pointer_t head; 
     
    279279 
    280280 
    281 LIBLF_CALLING_CONVENTION(void) ms96_queue_test(void) 
     281LIBLFDS_CALLING_CONVENTION(void) ms96_queue_test(void) 
    282282{ 
    283283    const char *s = "hello world!\n"; 
  • sfio/trunk/src/lockfree/ms96_queue.h

    r1094 r1095  
    55    multiple-reader, multiple-writer lock-free FIFO queue 
    66 
    7  
    8 Michael, M. M. and Scott, M. L., 
    9 "Simple, fast and practical non-blocking and blocking concurrent queue algorithms," 
    10 Proceedings of the 15th Annual ACM Symposium on Principles of Distributed 
    11 Computing (PODC), pp. 267--275, May 1996. 
    12 http://citeseer.ist.psu.edu/michael96simple.html 
     7    Michael, M. M. and Scott, M. L., 
     8    "Simple, fast and practical non-blocking and blocking concurrent queue algorithms," 
     9    Proceedings of the 15th Annual ACM Symposium on Principles of Distributed 
     10    Computing (PODC), pp. 267--275, May 1996. 
     11    http://citeseer.ist.psu.edu/michael96simple.html 
    1312*/ 
    1413 
    15 #define LIBLF_CALLING_CONVENTION( return_type )  return_type __stdcall 
     14#define LIBLFDS_CALLING_CONVENTION( return_type )  return_type __stdcall 
    1615 
    1716 
     
    2120#endif /* __cplusplus */ 
    2221 
    23 typedef void* ms96_value_t;     // this is the "payload" data type which is stored in the queue node 
    24                                 // the algorithm allows this to be anything, but at present (at least) 
    25                                 // we don't allow it to be (perhaps in future we could pass a special 
    26                                 // copy function to support other data types. 
     22typedef void* ms96_value_t;     /* this is the "payload" data type which is stored in the queue node 
     23                                    the algorithm allows this to be anything, but at present (at least) 
     24                                    we don't allow it to be (perhaps in future we could pass a special 
     25                                    copy function to support other data types) 
     26                                 */ 
    2727 
    2828struct ms96_queue_node_t; 
     
    5353 
    5454 
    55 // initialize queue, requires a node 
    56 LIBLF_CALLING_CONVENTION(void) ms96_queue_initialize( ms96_queue_t* queue, ms96_queue_node_t* node ); 
     55/* initialize queue, requires a node 
     56*/ 
     57LIBLFDS_CALLING_CONVENTION(void) ms96_queue_initialize( ms96_queue_t* queue, ms96_queue_node_t* node ); 
    5758 
    58 // deinitialize queue, expects queue to be empty and to stay that way 
    59 // returns a node 
    60 LIBLF_CALLING_CONVENTION(void) ms96_queue_terminate( ms96_queue_t* queue, ms96_queue_node_t** node ); 
     59/* deinitialize queue, expects queue to be empty and to stay that way 
     60    return the dummy link node used by the queue 
     61*/ 
     62LIBLFDS_CALLING_CONVENTION(void) ms96_queue_terminate( ms96_queue_t* queue, ms96_queue_node_t** node ); 
    6163 
    6264 
    63 // to engueue, supply a node (allocated from somewhere), and a value 
    64 // algorithm constraints: nodes must never be freed to the system, or unmapped 
    65 // from memory once they've been passed to enqueue. (not sure if there's also 
    66 // a memory class contraint here). 
    67 LIBLF_CALLING_CONVENTION(void) ms96_queue_enqueue( ms96_queue_t* queue, ms96_queue_node_t* node, ms96_value_t value ); 
     65/* to enqueue, supply a node (allocated from somewhere), and a value 
     66    algorithm constraints: nodes must never be freed to the system, or unmapped 
     67    from memory once they've been passed to enqueue. (not sure if there's also 
     68    a memory class contraint here). 
     69*/ 
     70LIBLFDS_CALLING_CONVENTION(void) ms96_queue_enqueue( ms96_queue_t* queue, ms96_queue_node_t* node, ms96_value_t value ); 
    6871 
    69 // dequeue returns a node, and the value 
    70 // returns non-zero on success 
    71 LIBLF_CALLING_CONVENTION(int) ms96_queue_dequeue( ms96_queue_t* queue, ms96_queue_node_t** node, ms96_value_t* value ); 
     72/* dequeue returns a node, and the value 
     73    returns non-zero on success, zero if the queue was empty 
     74*/ 
     75LIBLFDS_CALLING_CONVENTION(int) ms96_queue_dequeue( ms96_queue_t* queue, ms96_queue_node_t** node, ms96_value_t* value ); 
    7276 
    73 LIBLF_CALLING_CONVENTION(void) ms96_queue_test(void); 
     77LIBLFDS_CALLING_CONVENTION(void) ms96_queue_test(void); 
    7478 
    7579