Access Violation in Asynchronous Agents Pipeline Application
-
2012年1月29日 下午 11:04
i have an application use agent to implements simple image processing pipeline
i have three agents
- Load Bitmap Agent and this its run function
void CLoadBitmapAgent::run() { Bitmap *pSourceBitmap = new Bitmap(m_imagePath); asend(m_target,pSourceBitmap); done(); }
- Convert to Gray Agent and this is its run function
void CConvertToGrayAgent::run() { BitmapUtilities bitmapUtilities; Bitmap *pSourceBitmap = receive(m_source); bitmapUtilities.ParallelConvertToGray(pSourceBitmap); asend(m_target,pSourceBitmap); done(); } - Save Bitmap Agent and also its run function as follow
void CSaveBitmapAgent::run() { Bitmap * bitmap = receive(m_source); BitmapUtilities bitmapUtilities; CLSID clsid; bitmapUtilities.GetEncoderClsid(L"image/jpeg",clsid); bitmap->Save(L"D:\\final_image.jpg",&clsid); done(); }
i get access violation exception and i don't know why
i'm taking my first steps on parallel computing so i don't know how to solve it
you can get app from this link
https://skydrive.live.com/#cid=068215710BEF663D&id=68215710BEF663D!147
ImageProcessingPipeline Application
thanks so much
- 已編輯 Ma7moud El-Naggar 2012年1月29日 下午 11:06
- Load Bitmap Agent and this its run function
所有回覆
-
2012年3月13日 下午 11:21
Hi Ma7moud El-Naggar,
the AV is because of incorrect params (count) to agent::wait_for_all function in image_processing_pipline_main.cpp. It needs to be the following:
agent* agents[3] = {&loadBitmapAgent,&convertToGrayAgent,&saveBitmapAgent};
agent::wait_for_all(3,agents);
Thanks,
Vinod.
- 已提議為解答 Vinod SubramanianMicrosoft Employee 2012年3月13日 下午 11:21
- 已標示為解答 Ma7moud El-Naggar 2012年3月31日 上午 12:13

