15,883,809 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by yuzaihuan (Top 11 by date)
yuzaihuan
14-Jul-15 20:24pm
View
Hi, Karstenk, thanks for your attention.
I am not quite understand what your said. Could you show more detail?
In this project, I had two seperate cameras (two seperate threads/files, same as file1.c); image grabbing finished by two similar & seperate threads (in file2.c); of course, in file3.c, I provided two seperate call-backs, two seperate image buffers, two flags (mbSnapOk[0],mbSnapOk[1]).
yuzaihuan
15-Sep-14 3:15am
View
Thank u, KarstenK.
I have tested the code, it is OK.
Need add #include <windows.h> first.
yuzaihuan
4-Sep-14 21:42pm
View
POSIX is from Unix, but environment is Windows.
yuzaihuan
4-Sep-14 21:35pm
View
got it, I think I need add windows API to use "CreateMutex()" in my code.
yuzaihuan
3-Sep-14 20:47pm
View
It is OK in C++, or C#, but can I transform this code into C, if yes how to do ?
Thank you.
yuzaihuan
5-Mar-14 20:59pm
View
Very good, thank you.
yuzaihuan
5-Mar-14 5:03am
View
Thank you very much. SA.
yuzaihuan
3-Mar-14 22:59pm
View
Oh, using WaitAll() the compiler will show error: "WaitAll for multiple handles on STAThread is not supported", but the 3rd party Active controls I used in my code only supported in STAThread.
I have found a link: http://www.codeproject.com/KB/recipes/WaitHandleExceptions.aspx?display=Print, it may help me.
I don't know when a thread in a wait state, it will not cost any CPU.
Thank you. SA.
yuzaihuan
3-Mar-14 5:18am
View
Not know how to wait all the signals in an effective way.
yuzaihuan
3-Mar-14 5:03am
View
SA, thank you very much.
Can you help to improve my thread coding as above shown?
Before this, I will provide more info about my question:
My project is related with image processing. and I used 2 cameras, with 8 images grabbed by each camera. To decrease the whole processing time, I want to process each image once it was grabbed. In other words, I need process 16 images in total.
After processed, I need combine 2 cameras result (2 outputs, pass or fail) together, as "11", or "10", "00", "01" to other IO device.
Above code is for send result out.
1)I am not sure how to improve my send result out thread, as it need wait all the signals?
2)Previously I want to use Waithandle.WaitAll(signalArray,100,false), but the compiler shows error, as WaitAll only used in MTAThread. So I changed the Main() attribute from [STAThread] to [MTAThread] (my coding environment is VS C# 2005). But as I have used some 3rd part ActiveX control, which can't be used under [MTAThread], and I had to give up WaitAll();
3)I had some trial with WaitAll in console/WinForm application, it runs smoothly in normal state, but when I want to exit the code, seems it has less response to user input. Now I add a "Exit" button on the form, when it was clicked, it will call:
<pre lang="c#"> Interlock.Exchange(icKillAllThreads,1);</pre>
so you can see I did a check for icKillAllThreads value in above code.
Seems I know little about the 3rd parameters meaning for
<pre lang="c#">public static bool WaitAll(
WaitHandle[] waitHandles,
int millisecondsTimeout,
bool exitContext
)</pre>
, can you show me more about this?
Thank you again.
yuzaihuan
2-Mar-14 21:06pm
View
Sorry, not quite understood the MSDN documents.
In simple, I need wait all the signals, but can't use WaitAll(), how to do?
Show More