NetTalk Central

Author Topic: Synchronous Open and Multithreading  (Read 19960 times)

Thomas

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Synchronous Open and Multithreading
« on: August 26, 2007, 07:18:09 AM »
Hello,
when testing/playing with the synchronous Open feature of NetSimple I observed following behavior: while waiting for the timeout of an open request to a non existing server (..or wrong port) my App is completely blocked. I have a MDI App, only one MDI Client is performing the sync Open but the Frame and all other client Windows are completely blocked until this client returns from the sync Open.
Why ? I thought with preemptive multitasking the other (MDI) threads and the FRame should working normaly and only the one 'sync open thread' should be blocked.
Is the Nettalk Dll not multithreading aware ?
TIA, Thomas

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Synchronous Open and Multithreading
« Reply #1 on: August 26, 2007, 10:38:03 PM »
Hi Thomas,

It is completely multi-threading aware.
The reason for the blocking is technical, and specifically related to the synchronous open. That's after all what synchronous means.

Frankly, I can't think of a good reason to use a synchronous open, that's why the async open exists.

Cheers
Bruce

Thomas

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Email
Re: Synchronous Open and Multithreading
« Reply #2 on: August 27, 2007, 03:32:27 AM »
Hi Bruce,
thanks for your answer.

The reason for the blocking is technical, and specifically related to the synchronous open. That's after all what synchronous means.
But the question was why it is blocked at Process (API) level and not only at Thread level.

Quote
Frankly, I can't think of a good reason to use a synchronous open, that's why the async open exists.
;-) because the protocol wich I must implement demands it. I must offer both communication scenarios, async and sync to obey the protocol. With my first customer this is no prob because they use async in their server. But there could be another customer who needs sync. I would hate it to say No !

TIA, Thomas

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Synchronous Open and Multithreading
« Reply #3 on: October 31, 2007, 12:44:23 AM »
Hi Thomas,

I'm not sure how a protocol requires a sync, or async open. Usually a protocol discusses the data flowing up and down the pipe. why would a protocol insist on your program "stopping" during the open?

Perhaps I'm not understanding exactly what you mean here..?

cheers
Bruce