Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The list is like this
C++
#typedef CTypedPtrList<CPtrList, CBobject*>COblist;

class{
 COblist m_oblist;
 CBobject m_object // have picture object and Drawing() function
}

I want to use parallel_for_each for drawing Image of m_object.
How to use parallel_for_each with ramda function?
Mfc Container library(is not stl library) can use in parallel_for_each and ramda?
The following code does not work. How do i fix it?
Thanks for your time.

What I have tried:

C++
parallel_for_each(m_oblist.GetHead(), m_oblist.GetTail(), [&](){
   m_object->Drawing(fileheader.status/*struct*/, hFile/*FILE*/, filename/*CString*/)
}<pre>
Posted
Updated 13-Nov-17 1:33am
v2

1 solution

No,

Several problems:

1.) The parallel_for_each function expects iterator arguments.

2.) The CObList Class is not thread safe. I don't think any of the MFC containers have built-in thread safety.

Use an appropriate STL container.

C++ Standard Library Containers | Microsoft Docs[^]

Best Wishes,
-David Delaune
 
Share this answer
 
Comments
Chopin2001 13-Nov-17 9:05am    
Thanks David

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900