CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Feb 2009
    Posts
    252

    Unique buffer per thread

    hi

    I have a program that runs on a multithreaded enviroment but it needs to store things on a buffer the trouble is that i need a unique buffer per thread else the data would end mixing up.

    actually i do use a char array allocated on one intialization function on the class (cant be called on the constructor) since only certain instances will need it. and else i would get ou of memory.

    my buffer is a char array allocated in the heap, my main problem is that i cannot have a unique pointer to each of these buffers.

    if i declare the pointer as private member of the class i would have only one pointer in all threads right?

    how would i acomplish this goal, sugerencies and recomendations are welcome.

    thx in advance!!
    Last edited by Alphadan; October 27th, 2010 at 02:30 AM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured