Mike The Wiki is a wonderful resource for these sorts of things : http://en.wikipedia.org/wiki/Circular_buffer
Once you have read and understood - then take a look at the "CS" and "CDS" instructions (Compare and Swap) - you will need them to serialize the updates to the structure between your producer task(s) and consumer task(s). Rob Scott Rocket Software, Inc 275 Grove Street Newton, MA 02466 617-614-2305 [EMAIL PROTECTED] -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Ward, Mike S Sent: 15 July 2008 19:18 To: IBM-MAIN@BAMA.UA.EDU Subject: Circular buffer Hello listers, I have a question on circular buffers. I have an application that reads data in blocks. The data data I read is in 32k blocks. Each record in the block starts with a length in the first 2 bytes. When I get to the end of the 32k block I many have a partial record that starts in the next block I read. A colleague suggested I use a circular buffer. He's not to sure what it means and neither do I. I think it means to use the same buffer but in a circular fashion. The program is in assembler and I'm trying very hard to cope with it. Do any of you have a sample that I may borrow on how to do this circular buffer? Any feedback is welcome. Mike ========================== This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html