Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: lucky6969b

Page 1 of 33 1 2 3 4

Search: Search took 0.04 seconds.

  1. Re: Is stdext::hash_map's thread safe in free run environment?

    Is a critical section a better option for this situation?
    I want to make 4 copies of the same function and pass them as
    a function pointers to another function, and use critical section
    in each...
  2. Re: Is stdext::hash_map's thread safe in free run environment?

    Hello 2kaud,
    But how can I allocate within std::atomic wrapper, I got red-underlines for the resize statement
    on the actualCostsTbl variable? is it just the same way as normal, just wondering?...
  3. Re: Is stdext::hash_map's thread safe in free run environment?

    Back in here
    Just wondering how I can preallocate some memory for this vector of vector wrapped in the atomic data structure?


    static...
  4. Re: Is stdext::hash_map's thread safe in free run environment?

    Okay, I do see a dramatic boost in performance using multi-core processing even with the locking mechanism.
    Because I am using some fine-grained locks.

    Update1:
    Back again.
    I've got a data...
  5. Re: Is stdext::hash_map's thread safe in free run environment?

    Well, it doesn't work.. It still needs the unique_lock.
    Thanks
    Jack
  6. Is stdext::hash_map's thread safe in free run environment?

    I don't want to have mutex to slow down the rate of completion.
    So I want to have the threads run freely.
    But the data is shared.
    if I protect the data with find clause,
    is it still thread-safe?...
  7. How to do something similiar to invokeAndWait in Java?

    If I absolutely have to wait for the main thread to finish refreshing the screen before the worker thread makes another iteration or for at least a certain amount of frames to pass, how do I do that?...
  8. Re: Creating a shared_ptr in a method, and pass them out around.

    Yes, you're right. I think I just accidentally encounter a crash.
    I've built a small test program which pass out a shared_ptr from a factory
    which indeed didn't crash. So I have to check my main...
  9. Creating a shared_ptr in a method, and pass them out around.

    In case I had a shared_ptr created somewhere in a factory, just say,
    then the shared_ptr immediately goes out of scope when it exits the factory method.
    How to keep that pointer alive when I create...
  10. Re: How to close the main application by clicking on the console?

    Did you get to the CMyApp::~CMyApp and CSimApplication::~CSimApplication methods?
    I couldn't get to there.
  11. Re: How to close the main application by clicking on the console?

    I wrapped the application into a class, I think that's the only difference.
    In Igor's solution, the message pump is static.
    Thanks
    Jack
  12. boost::shared_ptr got released because of weak count = 1 or 0

    if (!OrderedOpenSet.empty()) {
    current.reset((NodePoolNode*)&(*OrderedOpenSet.begin()));
    }

    When the current pointer got reset (it is NULL in the first run and got overwritten in the next...
  13. Re: How to close the main application by clicking on the console?

    I wonder why this wouldn't work if I click on the console x button
    34055
  14. Replies
    7
    Views
    688

    Re: unordered map question

    Hello Arjay,
    I use a single lock per object, and single mutex per object and RAII at the same time, that seems to solve the problem
  15. Replies
    7
    Views
    688

    Re: unordered map question

    Currently, I just store the mutex locally in the GameObject class and dish out
    the mutex to the worker thread, and the worker thread has a std::map to
    store a pointer of that mutex. So they are...
  16. Replies
    7
    Views
    688

    Re: unordered map question

    I actually made the mutex global.
    If you meant to create the mutex at class scope,
    do I just pass the mutex between the 2 classes?

    I just found the worker thread writing to the container, while...
  17. Replies
    4
    Views
    329

    Re: List iterator is not incrementable

    thanks laserlight, I'll try that code too
  18. Replies
    4
    Views
    329

    Re: List iterator is not incrementable

    Thanks, it works!
    Jack
  19. Replies
    4
    Views
    329

    List iterator is not incrementable

    On the line


    for (std::list<MSG_Object*>::iterator i = m_delayedMessages.begin(); i != m_delayedMessages.end(); ++i)
    {

    The i variable has become 0xcdcdcdcdcd, It doesn't happen immediately,...
  20. Replies
    4
    Views
    564

    Re: Problem with deletion of Singleton.

    I am actually calling the DestroySingleton, Sorry for being misleading, I meant I call the destructor of my main application, which in turn
    calling ShelvingSingleton::DestroySingleton() which...
  21. Replies
    4
    Views
    564

    Problem with deletion of Singleton.

    When I the application exits, it calls on the destructor, the destructor in turn calls the
    CShelvingSingleton::DestroySingleton(); function, I had a similar Singleton which precedes this call,
    but...
  22. How to close the main application by clicking on the console?

    I spawned a console from the main application as a log window.
    But when I clicked on the x of the main app, the application just won't stop execution.
    When I clicked on the x of the console, it...
  23. Replies
    7
    Views
    688

    Re: unordered map question

    Have tried to lock it with std::unique_lock over the critical section.
    But still got this



    mapped_type& operator[](key_type&& _Keyval)
    { // find element matching _Keyval or insert with...
  24. Replies
    7
    Views
    688

    unordered map question

    I encounter this error when there are 2 threads interweaving with this data structure.
    The main thread that deals with a front and a pop_front operation
    and a worker thread that deals with clear...
  25. Re: Obtaining a value from a std::set and letting it be a variable.

    Where can I find the best references for smart pointers? I want to take a read on that topic.
    I tried once to use those, but my program start to become unstable. I didn't understand them very well....
Results 1 to 25 of 821
Page 1 of 33 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!


HTML5 Development Center