I wonder if .Net makes that a bit easier than in C++. hmm. I rememebr you mentioning this in times past jasuk70.
There is another way - less "demanding" and a little more riske' for passing data back and forth between threads - its less intrusive - and you need to know if it works for you or not before hand - or it could let you down.
1: Why use? Can speed things up
2: Drawbacks? Timing is haphazard because no "Critical section"/mutex/sync logic
3: why it can work? because ONE memory location (32bit) can not be written too at the same moment another thread tries.
Make a UDT for Data going from thread1 to thread2, and another for any data going from thread2 to thread1. Make your code guarantee that One thread writes while the other only reads from a given UDT.
This allows info to be "shared" - but not necearily in sync - avoid dead locks/syncing etc. Use with care. [edit]spelling change[/edit]
This basically allows interprocess communication - without ever making either side WAIT. Though - this could be considered sloppy - but its not - it just doesn't care what either thread is doing. so your threads need to play nice - and it works
If you need DEAD ON - RELIABLE (from a timing standpoint) info - than mutex stuff is the way to go.
[edit] if you pass more than one field at a given time - like a record of data - go with mutex.[/edit]