Sponsored Content
Full Discussion: Atomicity
Top Forums Programming Atomicity Post 51097 by S.P.Prasad on Tuesday 11th of May 2004 01:33:28 AM
Old 05-11-2004
Please visit the link within this post.

_check_lock and _clear_lock on AIX


I tested the code implementing the routines and the code behaves fine in Unit testing.

Also if someone can explain me in detail "The word variable must be aligned on a full word boundary." as stated in the page. Please correct me if I am worng - "A group of related bytes that are treated as a single addressable unit or entity in memory is called as a WORD. Hence size of a word varies from one computer to another, depending on the CPU. For computers with a 16-bit CPU, a word is 16 bits (2 bytes)."

Single Word = Single addressable unit by CPU
Word Boundary = Address completely divisible by number of bytes that represents a single addressable unit.

Example Single Word length = 16 bits then a word boundary is any address that is completely divisible by 16, which would mean that the variable referenced here should begin at 0,16,32,48,64 ... and so on memory locations and the variable should consume 16 bits of memory.

Am I correct? What extra care should I take into account during coding?

Please let me know whether these are a proven set of standard 'C' routines. Please let me know your honest opinions before I put it into the production system and have a go.

Thanks in advance

Last edited by S.P.Prasad; 05-11-2004 at 05:11 AM..
 
DOC(4)							     Kernel Interfaces Manual							    DOC(4)

NAME
DOC - (Pilot standard text document) file format SYNOPSIS
struct doc_record0 { /* 16 bytes total */ Word version; /* 1 = plain text, 2 = compressed text */ Word reserved1; DWord doc_size; /* uncompressed size in bytes */ Word num_recs; /* not counting itself */ Word rec_size; /* in bytes: usually 4096 (4K) */ DWord reserved2; }; DESCRIPTION
The Doc file format is the standard text document format used by all models of the Palm Pilot. A Doc file is a pdb(4) file: this manual page describes only those aspects specific to Doc files. A Doc file consists of 0 to num_recs records; record 0 is the header for the document. (This header is distinct from the pdb(4) header.) The remaining records contain text, either plain or compressed depending upon version. Word Sizes In the synopsis above, the types ``Word'' and ``DWord'' are used just as in the Pilot headers. The type ``Word'' is 16 bits; the type ``DWord'' is 32 bits. Both are in big-endian format. Compression Format A character ``c'' in a compressed record is in one of four classes: 01-08 Copy ``c'' bytes 00,09-7F Self 80-BF Sequence C0-FF A space plus the ASCII character ``c ^ 0x80'' SEE ALSO
txt2pdbdoc(1), html2pdbtxt(1), pdbtxt2html(1), pdb(4) Christopher Bey and Kathleen Dupre. Palm File Format Specification, Document Number 3008-003, Palm, Inc., May 16, 2000. AUTHOR
Paul J. Lucas <pauljlucas@mac.com> txt2pdbdoc January 21, 2005 DOC(4)
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy