Recent

Author Topic: WM_COPYDATA and deadlock?  (Read 6488 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1055
WM_COPYDATA and deadlock?
« on: February 03, 2011, 03:33:18 pm »
Hi,

I'm writting communication between two applications. First App send message to second and second send response on this same way. I have question about deadlock. In my theory when first application call SendMessage (which waiting for handle this message) and second application response by SendMessage too (and waiting for handle response message) then should be deadlock, am I right? But I am testing and there is no deadlock. Why? Event if I send 100 messages in loop, second application can reponse on all. I'm just lucky?

Regards

Leledumbo

  • Hero Member
  • *****
  • Posts: 8783
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: WM_COPYDATA and deadlock?
« Reply #1 on: February 03, 2011, 09:06:27 pm »
Which SendMessage are you using? AFAIK the LCL implementation (not from Windows unit) doesn't block. If you want a deadlock, try PostMessage instead.

Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: WM_COPYDATA and deadlock?
« Reply #2 on: February 03, 2011, 09:37:13 pm »
I am using from Windows and it looks that this method doesn't block too. I know that in this case, I should not complain, seems my theory was wrong.
Quote
If you want a deadlock, try PostMessage instead
I can't use it, because in this way I oblige receiver to free incoming data

 

TinyPortal © 2005-2018