Commit Graph

540 Commits

Author SHA1 Message Date
Marc-André Moreau
34f9985add freerdp: merge with master 2013-08-07 15:48:57 -04:00
Marc-André Moreau
331933635c Merge pull request #1401 from nfedera/fix-2013-08-07-02
libwinpr-utils: Use criticalsection with spincount
2013-08-07 12:35:46 -07:00
Norbert Federa
3a58934eb2 libwinpr-utils: Use criticalsection with spincount
Use InitializeCriticalSectionAndSpinCount instead of IntializeCriticalSection.
Using spin counts for critical sections of short duration enables the calling
thread to avoid the wait operation in most situations which can dramatically
improve the overall performance on multiprocessor systems.

On Linux this change has no effect because the new winpr critical section
implementation does not use the SpinCount field under Linux because the NPTL
synchronization primitives are implemented using the extremely performant
futex system calls which have this magic already built in.

However, on Mac OS X this change improved the overall performance of the
multithreaded RemoteFX decoder by 25 percent.

I've used a SpinCount of 4000 which avoided 99 percent of the wait calls.
This value is also used by Microsoft's heap manager for its per-heap
critical sections.

Note: This change requires pull request #1397 to be merged.
2013-08-07 18:16:01 +02:00
Norbert Federa
2b25b4a520 libwinpr-sync: New complete critical section code
- Complete implementation including recursion support
- Added an intensive ctest (TestSynchCritical)
- Struct members are used exactly as Windows does it internally:
  LockCount starts at -1, RecursionCount at 0
- Same performance optimizations as internally on Windows:
    - Fast lock acquisition path using CAS -> SpinCount -> wait
    - SpinCount automatically disabled on uniprocessor systems
- On Linux SpinCount is disabled because it provided no advantage over NPTL/futex in all tests

Support for CRITICAL_SECTION's DebugInfo is not yet included (but trivial to add).
2013-08-07 10:20:04 +02:00
Marc-André Moreau
7b80b19306 cmake: add FindPixman.cmake 2013-08-05 20:50:23 -04:00
Marc-André Moreau
13872f33bf libwinpr-utils: implement doubly-linked list 2013-08-05 17:29:14 -04:00
Marc-André Moreau
190ed85a3d libwinpr-synch: add detection of timerfd support 2013-08-03 19:50:17 -04:00
Marc-André Moreau
ecc543d87d Merge branch 'master' of github.com:FreeRDP/FreeRDP into multitouch 2013-08-03 16:22:09 -04:00
Norbert Federa
81ef251fc8 winpr: improve and fix locking for data structures
- Improved/completed(almost) winpr's critical section implementation
- Replaced WaitForSingleObject locking with critical sections

Note:
WaitForSingleObject should _never_ be used for granular low-contention
locks as it _always_ enters the kernel.

Just replacing WaitForSingleObject locking in Bufferpool with
EnterCriticalSection boosts the multithreaded rfx decoder
performance by almost 400% on win32.
2013-08-02 12:07:05 +02:00
Marc-André Moreau
913d532e0d winpr: fix build on Linux 2013-07-30 10:57:54 -04:00
Marc-André Moreau
4d2bc6ba46 libwinpr-synch: add unit tests, initial waitable timer support 2013-07-29 13:07:39 -04:00
Marc-André Moreau
007bd87ff4 libwinpr-synch: start implementing waitable timers 2013-07-29 11:57:29 -04:00
Marc-André Moreau
8a4e83bdfb libfreerdp-core: fix server-side update encoding edge case 2013-07-28 16:31:38 -04:00
Benoît LeBlanc
03a401b8e6 CMakelists:
disabled installation of headers and libraries for the wayk client.
2013-07-25 21:59:21 -04:00
Marc-André Moreau
bef2ad5c92 libwinpr-pipe: added overlapped io tests for named pipes 2013-07-23 15:03:08 -04:00
Marc-André Moreau
507899ade9 libwinpr-pipe: initial basic named pipe support 2013-07-22 23:17:08 -04:00
Marc-André Moreau
65bc944def libwinpr-pipe: implement of more named pipes 2013-07-22 22:53:44 -04:00
Marc-André Moreau
afe1f22bcf libwinpr-pipe: start implementing named pipes 2013-07-22 18:20:34 -04:00
Marc-André Moreau
c6764f9034 libwinpr-pipe: added stubs for named pipes 2013-07-22 16:30:25 -04:00
Benoît LeBlanc
163cc975d9 Merge branch 'master' of git://github.com/awakecoding/FreeRDP
# By Marc-André Moreau
# Via Marc-André Moreau
* 'master' of git://github.com/awakecoding/FreeRDP:
  libwinpr-utils: implement ListDictionary
2013-07-07 22:02:09 -04:00
Marc-André Moreau
b3265b6958 libwinpr-utils: implement ListDictionary 2013-07-05 18:23:26 -04:00
Benoît LeBlanc
d72452b4f5 Merge branch 'master' of git://github.com/awakecoding/FreeRDP
# By Bernhard Miklautz (4) and others
# Via Marc-André Moreau
* 'master' of git://github.com/awakecoding/FreeRDP:
  libfreerdp-core: fix unused variable
  libfreerdp-codec: add bitmap encoder
  cmdline: unix/windows return detected error
  client/common: fixed command line parsing issue
  channels/serial: bring it back to life
  nla: invalidate sec handle after creation
  tls: updated certificate mismatch message
2013-07-05 16:35:08 -04:00
Benoît LeBlanc
c17c2f811b FreeRDP:
- replaced char* by const char* in function prototypes
- MacFreeRDP: moved assignation of context function pointers
- freerdp: added more pointer and return value validations to prevent crashes
2013-07-04 14:42:40 -04:00
Bernhard Miklautz
0773bb9303 nla: invalidate sec handle after creation
If sec pointer isn't invalidated after creation it is not possible
to check if the upper and lower pointers are valid.

This fixes a segfault in the server part if the client disconnects before
the authentication was finished.
2013-07-01 19:24:19 +02:00
Marc-André Moreau
863b51f938 freerdp: merge with master 2013-06-28 12:50:24 -04:00
Marc-André Moreau
48347b1f4d Merge pull request #1305 from bmiklautz/mem_alignment
winpr: offset support in _aligned_offset_malloc
2013-06-28 09:39:02 -07:00
Marc-André Moreau
3fbc4f899f libwinpr-utils: fix deadlock in PubSub 2013-06-27 14:16:50 -04:00
Marc-André Moreau
77f5994e1c winpr: add _WINRT platform detection macro 2013-06-26 18:12:01 -04:00
Martin Fleisz
14e81877fb Merge pull request #1294 from bmiklautz/null_handle
winpr: check added if handle is NULL
2013-06-26 05:48:30 -07:00
Marc-André Moreau
c66b79ad46 winpr: extend stream api 2013-06-25 16:46:55 -04:00
Norbert Federa
786df03bb6 libwinpr-synch: fix broken USleep (on WIN32)
Also reduce CPU usage by reducing the max busy-looping time to 1ms
2013-06-25 16:33:40 +02:00
Marc-André Moreau
31f68d0779 winpr: fix type conflict with X11 2013-06-24 23:58:31 -04:00
Bernhard Miklautz
b0d69caee8 winpr/alignment: use size_t instead of UINT32 2013-06-19 19:07:31 +02:00
Marc-André Moreau
fbf3208b0a libwinpr-utils: rename certain PubSub functions 2013-06-18 21:23:26 -04:00
Bernhard Miklautz
40ea683982 winpr: offset support in _aligned_offset_malloc
Added support to handle offset parameter in _aligned_offset_ functions.
fixes #1299
2013-06-18 18:43:59 +02:00
Marc-André Moreau
508bae674b libwinpr-utils: improve PubSub with automatic strongly-typed helpers 2013-06-18 00:39:48 -04:00
Marc-André Moreau
c76efec345 wfreerdp: update client with new API 2013-06-15 22:57:21 -04:00
Marc-André Moreau
e77d4657e4 libwinpr-utils: add PubSub multiplexing and synchronized access 2013-06-15 18:18:02 -04:00
Marc-André Moreau
6c9a3b8e64 freerdp: start using pubSub for client GUI events 2013-06-15 17:01:10 -04:00
Marc-André Moreau
95a129eb69 libfreerdp-client: start splitting termination and printing logic for CLI parsing 2013-06-15 15:13:38 -04:00
Marc-André Moreau
8ad532a9d4 libwinpr-utils: implement basic Publisher/Subscriber pattern 2013-06-15 13:32:13 -04:00
Marc-André Moreau
174d1bdd71 libwinpr-utils: start implementing Publisher/Subscriber pattern 2013-06-14 16:55:05 -04:00
Christian Plattner
9373787fb1 winpr: check added if handle is NULL 2013-06-14 15:41:06 +02:00
Marc-André Moreau
2bd6808432 freerdp: merge with master 2013-06-05 10:31:01 -04:00
Daryl Poe
86156ce61f fix memory errors due to too-large memcpy in ArrayList 2013-06-03 09:30:14 -06:00
Marc-André Moreau
9d3ec97f9e freerdp: fix monolithic build with Xcode 2013-05-24 18:38:02 -04:00
Marc-André Moreau
8a2220a3d9 libwinpr-synch: remove unnecessary critical section 2013-05-16 19:27:12 -04:00
Marc-André Moreau
c0160b8015 libwinpr-handle: reduce usage of unneeded handle management functions 2013-05-16 18:27:26 -04:00
Marc-André Moreau
23e8af45f0 libwinpr-handle: don't use a centralized handle table as it was a major performance bottleneck 2013-05-16 18:14:37 -04:00
Marc-André Moreau
f8b24826da libwinpr-handle: optimize handle table lookup 2013-05-16 17:49:41 -04:00