×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Circular Buffer Synchronous

    Hi,
    I need to do a Circular Buffer Synchronous, how to get information about this?
    I work on 3rd edition.
    Thanks
    Silvia

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Circular Buffer Synchronous

    What about CCirBuf?

  3. #3
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: Circular Buffer Synchronous

    Quote Originally Posted by Paul.Todd View Post
    What about CCirBuf?
    I need to implement this:
    I need of a thread that write ever on a buffer;
    I need of a thread that read on this buffer but, when you read other thread must not write.
    If buffer is full, the first thread must write in the start of buffer.

    Is possible do this whit CCircle?
    I hope to be clear.
    Thaks
    Silvia

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Circular Buffer Synchronous

    You can but it will be up to you to put a layer over the top to ensure the buffer is in a consistant state across threads (ie Thread Safe)

    You don't want a circular buffer, you want a producer/consumer queue
    See RMsgQueue which is thread safe

    Personally I recommend not using threads.

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: Circular Buffer Synchronous

    Hi,

    I can imagine CCirBuf + some sync between thread(mutex, rendesvous AO) - the global RMsgQueue seems to be interesting solution - that's the first time I heard about this class (it's good to go throught the forum I didn't get is it LIFO or FIFO?

    BR
    STeN

  6. #6
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Circular Buffer Synchronous

    Its FIFO, though its better to think of it more in terms of two sides where one produces results and the other side consumes ("eats") the results.

    This allows really efficient operation as the two sides can use AO's (via RMsgQueueBase) to coordinate queues.

    The queues can also be shared across processes as well as threads, though there is a 64 limit on a queue entry.

  7. #7
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    252

    Re: Circular Buffer Synchronous

    Many thanks for Idea
    Now study RMsgQueue api, but there is a example of use in sdk?
    can I use two object active with RMsgQueue?
    Another question: operation of read on this RMsgQueue is locked?
    Thans
    Silvia

Similar Threads

  1. Replies: 6
    Last Post: 2005-10-03, 05:51
  2. Dialog's clipping area (again). Nokia experts, please help
    By synov in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-06-26, 14:35
  3. Nokia 30 SMS sending problem !!!!!
    By pgredelj in forum General Messaging
    Replies: 1
    Last Post: 2004-01-12, 12:48
  4. Setting up drawPixel Buffer
    By mariusfahlbusch in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2003-11-01, 13:25
  5. SMS Msg using VB Application
    By gurup83 in forum General Messaging
    Replies: 2
    Last Post: 2002-07-11, 04:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×