DCSIMG
Threading - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

WPF 4.5: Accessing bound collections on non UI threads
21 July 12 12:23 PM | pavely | with no comments
The single threaded behavior of WPF (and other UI technologies) requires that anything tied to the user interface be manipulated on the UI thread, incuding data bound objects. There are several ways to do that, assuming the code is on a non-UI thread, such as using Dispatcher .( Begin ) Invoke , capturing and using the current SynchronizationContext , etc. Specifically, if some collection is data bound, items cannot be added or removed from it from a non-UI thread. WPF 4 (and earlier) throws an exception...
Presentations I’ll be giving this month
13 March 12 11:03 PM | pavely | 2 comment(s)
This month turned out to be a busy one for me, at least as far as public presentations are concerned. All sessions are free of charge, but you should register – details follow: Parallel and Asynchronous Programming with .NET 4/4.5 and C# 5.0 This session is to be held on the 20th, at John Bryce offices in Tel Aviv. I will do a quick recap of tasks and the Parallel class, and then move to async programming with and without the new C# 5.0 features. I will be using VS 2010 and the recently released...
Windows Platform Developers User Group (Sep 2011) Meeting
11 August 11 10:37 AM | pavely | with no comments
After some time of inactivity, the WPDUG is back! Our next meeting will be held on September 7th, in Microsoft Offices in Ra’anana. The agenda and registration form is here . Please register so you’d have a parking space and enough food is presented… See you there!
Windows Platform Developers UG Session
24 February 10 10:00 AM | pavely | 1 comment(s)
Last night I delivered a session entitled “Writing Software Device Drivers on Windows” in the Windows Platform Developers user group . I gave a “crash course” of 1.5 hours on writing a driver that allows me to execute code within the kernel to do things that are not possible from user mode. Thank you all for coming and for the great feedback! I’ve attached the presentation and the demo code, including the driver code, the installer and the client application. Note that to compile successfully with...
ThreadPool and Robotics Studio
06 January 08 01:23 PM | pavely | with no comments
בעולם של ה-CLR לא קשה לבצע פעולות אסינכרוניות. למשל, כל delegate תומך אוטומטית בהפעלה אסינכרונית ע"י BeginInvoke ו-EndInvoke. מי שצריך לעבוד ללא delegate יכול להשתמש ב-ThreadPool שלו מספר מתודות סטטיות להפעלת method בצורה אסינכרונית. הבעיה ב-ThreadPool היא שהינו יחיד. כלומר, אם יש מצב שבו יש באפליקציה שתי סוגי בקשות, אחת בעדיפות רגילה ואחת בעדיפות גבוהה, הן ייזרקו לאותו תור שמנהל את הבקשות האסינכרוניות, ואם לדוגמא, יש 100 בקשות רגילות בתור ואז צריך להעביר בקשה בעדיפות גבוהה, הבקשה תאלץ לחכות...