Home Forums .NET libraries Xceed SFTP/FTP for .NET SynchronizingObject

Viewing 1 post (of 1 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #20615 |

    Hello everybody.

    I’m currently working on the async operations for the next release of Xceed FTP for .NET. Basically, the library will now offer a series of <b>BeginSomething/EndSomething</b> pair, following the .NET Framework guidelines regarding <b>IAsyncResult</b> and asynchroneous operations.

    I’m juggling with the idea of offering a <b>SynchronizingObject</b> property, similar to <A HREF=”http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtimerstimerclasssynchronizingobjecttopic.asp”>System.Timers.Timer</A&gt; offers. It would make sure to marshall all events and completion callbacks on the main UI thread, so you don’t have to use the form’s <b>Invoke/BeginInvoke/EndInvoke</b> methods yourself.

    But questions are raised with this. Should I use <b>BeginInvoke</b> (so make events not block the underlying code) as often as possible (i.e. when the event has only “in” params)? Or should I always use <b>Invoke</b>, so everything seems synchronized? Or is this property plainly useless, and you guys prefer to handle UI thread affinity yourself? Is it right to marshall both events and completion callbacks with that property? Or would you expect it to marshall only events? And the final question for those of you developping UI applications: have you ever heard of all the above, or is it all news to you, and you weren’t aware you had to make sure to call controls and the form from the main thread?

    Thank you for all your comments! 😀

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Martin (had 4153 views)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.