search for: critical_section

Displaying 20 results from an estimated 23 matches for "critical_section".

2007 Oct 21
2
Simulating RUBY_CRITICAL
Hi all, I''ve added some critical section methods to the Windows::Synchronize module in the windows-pr library (in CVS). Looking at the RUBY_CRITICAL macro from rubysig.h, it basically looks like this (in pure Ruby): def RUBY_CRITICAL(&block) critical_section = [0].pack(''L'') InitializeCriticalSection(critical_section) EnterCriticalSection(critical_section) block.call LeaveCriticalSection(critical_section) end But, shouldn''t we ensure that we leave the critical section once entered, like so? # This is what...
2010 Nov 20
1
CRITICAL_SECTION hang my application
...the code in C++: Code: HWND__ *h_Edit = rtf_list->Handle; EnterCriticalSection(&cr_sec); CHARRANGE cr; cr.cpMin = 0; cr.cpMax = 0; // App hangs on this line SendMessage(h_Edit, EM_EXSETSEL, 0, (LPARAM)&cr); //..... LeaveCriticalSection(&cr_sec); Before this I use: Code: CRITICAL_SECTION cr_sec; InitializeCriticalSection(&cr_sec); to initialize Critical Section.
2009 May 20
2
Encoder crash in multithreading processing
...to work with CELT encoder & decoder in 2 different threads at the same time. So I create/destroy encoder and encode in one thread and create/destroy decoder and decode in other thread. If I didn't protect celt_encoder_create, celt_encode_float and celt_decoder_create, celt_decode_float with CRITICAL_SECTION I get stable error in icwrs32 or ec_byte_write1 (more often) in encoder. What does it mean ? Is CELT not thread-safe ? Any way to avoid this error except CRITICAL_SECTION ? Sergei ps: I use last version from git repository, but I also checked with previous version and with 2 compilers VC++ 2008...
2009 May 17
1
[LLVMdev] RFC: Atomics.h
...h static constructors. This means that we can't use a mutex with a non-constant initializer, or else we can't depend on it being properly initialized before the ManagedStatic is accessed. While this would be possible with pthread mutexes, I know of no good way to do it for Windows CRITICAL_SECTION's. --Owen -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4463 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090517/907801f3/attachment.bin>
2014 May 30
2
[LLVMdev] Use of Vectored Exception Handlers for crash recovery
...x and std::recursive_mutex, I found that many of the tests were failing on Windows after doing the replacement. One of the reasons was due to the use of a mutex in lib\Support\CrashRecoveryContext.cpp. If this mutex is an std::recursive_mutex or std::mutex, tests fail. If this mutex is a windows CRITICAL_SECTION, the tests pass. I *think*, but am not 100% sure, that this is due to an interaction between MSVC's mutex implementation and the use of vectored exception handling. There is a comment in this file that says the following: // On Windows, we can make use of vectored exception handling to // ca...
2005 Sep 18
2
How does the jitter buffer "catch up"?
> (PS, if you do use threads, protect speex_jitter_put/get with a mutex > (CRITICAL_SECTION I believe they're called in Win32Speak) -- calling put > and get at the exact same time from different threads leads to "features") I've never tested this, but I designed the jitter buffer to work from two threads even without using a mutex. This would work as long as there i...
2014 Jun 27
0
Wine release 1.7.21
...Caban (18): msvcrt: Use size_t to store indexes in qsort. msvcrt: Allocate data with 16-bytes alignement if small blocks heap is used. msvcrt: Add small blocks heap tests. msvcr100: Add _SpinWait implementation. msvcr100/tests: Add _SpinWait tests. msvcr100: Add critical_section class stub. msvcr100: Add critical_section::scoped_lock implementation. msvcr100: Add critical_section class implementation. msvcr110: Add critical_section::try_lock_for implementation. msvcp110: Add missing exports to msvcp110.spec file. kernel32: Fix typo in enum_loc...
2005 Sep 18
0
How does the jitter buffer "catch up"?
>> (PS, if you do use threads, protect speex_jitter_put/get with a mutex >> (CRITICAL_SECTION I believe they're called in Win32Speak) -- calling put >> and get at the exact same time from different threads leads to "features") > > I've never tested this, but I designed the jitter buffer to work from > two threads even without using a mutex. This would work a...
2009 May 17
0
[LLVMdev] RFC: Atomics.h
Owen Anderson wrote: > > On May 16, 2009, at 7:47 PM, Luke Dalessandro wrote: > >> Also, atomic ops are usually pretty low level things used for >> nonblocking algorithms or to build higher level locking constructs. Is >> that the plan here too? It seems like you'd want to avoid anything too >> fancy since LLVM has to run on so many different architectures
2005 Sep 18
2
How does the jitter buffer "catch up"?
Thank you for a very good explanation which shed light on some of the questions that I had after reading the source code. Reading your text however, I wonder if I'm perhaps missing an important point on the proper use of the jitter buffer: ... > Now, clearly, if early_ratio is high and late_ratio is very > low, the buffer is buffering more than it needs to; it will > skip a frame
2005 Sep 18
0
How does the jitter buffer "catch up"?
...t and play that frame. Meaning, even if no packet arrived in the last 20 ms, you should still call speex_jitter_get, and no matter if 100 packets arrived in the last 20 ms, you should still only call speex_jitter_get once. (PS, if you do use threads, protect speex_jitter_put/get with a mutex (CRITICAL_SECTION I believe they're called in Win32Speak) -- calling put and get at the exact same time from different threads leads to "features") This allows the jitter buffer to actually buffer, and try to keep the delay between frame arrivel and frame play to a minimum. As for detecting outages...
2009 May 17
3
[LLVMdev] RFC: Atomics.h
On May 16, 2009, at 7:47 PM, Luke Dalessandro wrote: > Owen Anderson wrote: >> Some of you may have noticed that I addedd include/llvm/System/ >> Atomics.h >> to the repository briefly, which will be used for adding support for >> threading in LLVM. > > Just out of curiosity, is there a design document somewhere for the > plan > for threading? Not as
2009 May 17
0
[LLVMdev] RFC: Atomics.h
...s. This means that we can't > use a mutex with a non-constant initializer, or else we can't depend > on it being properly initialized before the ManagedStatic is > accessed. While this would be possible with pthread mutexes, I know > of no good way to do it for Windows CRITICAL_SECTION's. Actually, global static constructors are evil and should be eliminated. No static constructors should do anything non-trivial, and it is essential that ManagedStatic *not have a constructor*. That is its entire design point. However, ManagedStatic should theoretically pretty simp...
2005 Sep 22
0
How does the jitter buffer "catch up"?
...r_get and play that frame. Meaning, even if no packet arrived in the last 20 ms, you should still call speex_jitter_get, and no matter if 100 packets arrived in the last 20 ms, you should still only call speex_jitter_get once. (PS, if you do use threads, protect speex_jitter_put/get with a mutex (CRITICAL_SECTION I believe they're called in Win32Speak) -- calling put and get at the exact same time from different threads leads to "features") This allows the jitter buffer to actually buffer, and try to keep the delay between frame arrivel and frame play to a minimum. As for detecting outages,...
2009 May 17
2
[LLVMdev] RFC: Atomics.h
OK, I've enhanced Atomic.h by pulling in a bunch of implementations from libatomic_ops, and others that I could figure out on my own. Again, my plea: PLEASE TRY THIS OUT ON YOUR PLATFORM, AND SEND ME PATCHES IF IT DOESN'T WORK! Similarly, if you think the implementation could be improved for your platform, send me a patch. I know that Sparc doesn't work currently (no CAS
2006 Dec 07
0
Fwd: win32-service problems with patch
...hThread; static HANDLE hStartEvent; static HANDLE hStopEvent; static HANDLE hStopCompletedEvent; @@ -21,12 +22,6 @@ static DWORD dwServiceState; static TCHAR error[1024]; -static VALUE EventHookHash; -static VALUE thread_group; -static int cAdd; -static int cList; -static int cSize; - CRITICAL_SECTION csControlCode; // I happen to know from looking in the header file // that 0 is not a valid service control code @@ -39,7 +34,6 @@ static VALUE service_close(VALUE); void WINAPI Service_Main(DWORD dwArgc, LPTSTR *lpszArgv); void WINAPI Service_Ctrl(DWORD dwCtrlCode); -void ErrorStopServic...
2019 Mar 03
0
Wine release 3.0.5
...get_instr_length(). Pierre Schweitzer (1): msi: Don't consider read-only drives when enumerating volumes. Piotr Caban (10): msvcr120: Added _Cbuild implementation. msvcp140: Added _Winerror_message implementation. msvcr100: Use scoped_lock internal buffer when locking critical_section. msvcr100: Add _NonReentrantPPLLock class implementation. msvcr100: Add _ReentrantPPLLock class implementation. msvcr100: Add _ReentrantPPLLock::_Scoped_lock class implementation. msvcr100: Added _Scoped_lock::_NonReentrantPPLLock class. msvcrt: Support "China&quo...
2015 Feb 20
0
Wine release 1.7.37
...pty initializer braces. quartz: Avoid empty initializer braces. winegstreamer: Avoid empty initializer braces. gdi32/tests: Avoid variable length arrays (MSVC). Uwe Bonnes (1): ntdll: Add more serial speed settings. Yifu Wang (1): msvcr120: Fixed bugs in Concurrency::critical_section. -- Alexandre Julliard julliard at winehq.org
2016 Aug 19
0
Wine release 1.9.17
...orrect index to remap the axis. dinput: Implement DIPROP_PRODUCTNAME in GetProperty. dinput: Cope with NULL flags in LinuxInputEffectImpl_GetEffectStatus. Daniel Lehman (16): msvcp140: Implement _Thrd_hardware_concurrency. concrt140: Add concrt140 stub. msvcp140: Load critical_section functions from concrt140. msvcp140: Take _Mtx_t and _Cnd_t directly. msvcp140: Add _Mtx_init/destroy_in_situ. vcomp140: Add vcomp140 stub. msvcp140: Don't redirect _Cnd/Mtx_t to msvcp110. msvcp140: Add _Query_perf_[counter|frequency]. ntdll: Call __finally bl...
2016 Mar 04
0
Wine release 1.9.5
...DULE address. winedevice: Get rid of global driver_hkey variable and fix some leaks. advapi32/tests: Improve RegDeleteTree tests. advapi32/tests: Add tests for RegCopyTree. advapi32: Simplify and clean up RegDeleteTree implementation. oleaut32: Set DebugInfo for static CRITICAL_SECTION structure. wined3d: Fix transposed lines in WARN message. wined3d: Fix TRACE in wined3d_texture_update_desc function. services: Consistently use InterlockedIncrement to increment refcount. services: Remove pipe argument from service_send_command function. services: Do...