16,016,814 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 .NET 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 Fred van Lieshout (Top 6 by date)
Fred van Lieshout
24-Feb-23 4:41am
View
Excellent explanation, thank you so much! I'm a newbie to C#, hence my experiment with this. Did not expect this at all, but definitely something to keep in mind!
Fred van Lieshout
23-Feb-23 8:05am
View
Thanks! The thing is, it does not time out. I would have seen the exception then. I suspect there's an issue with the underlying code. Despite the documentation saying that it is thread safe, it appears that it is not (at least not 100%). The Status property is set to 'RanToCompletion', but the IsCompleted is 'false'. Until I log it again, then it is true. It is also logged immediately as 'true' when I log log it from the same thread context, i.e. in the OnCompleted callback. But never mind, I was just experimenting a bit.
Fred van Lieshout
21-Feb-23 10:48am
View
Your feedback is very much appreciated. Thanks!
Fred van Lieshout
21-Feb-23 10:32am
View
Fair point!
Fred van Lieshout
21-Feb-23 10:30am
View
You could take a look at SWIG: https://www.swig.org/Doc3.0/CSharp.html
Fred van Lieshout
21-Feb-23 10:25am
View
Thanks for the quick reply and the suggested improvements.
The weird thing is that it all works when using the 'await' keyword, which obviously is the recommended way to go. I was just surprised to see the 'IsCompleted' property not being set to 'True', while the status of the task is actually 'RanToCompletion'. It just doesn't add up.
Show More