I'd like to have a thread block unless one of two semaphores were triggered... Win32 has WaitForMultipleObjects. IS there anything similar for DSP/BIOS? Carl Chipman Nomadics, Inc. http://www.nomadics.com |
|
Waiting on Multiple Semaphores
Started by ●December 12, 2001
Reply by ●December 13, 20012001-12-13
> I'd like to have a thread block unless one of two semaphores
were > triggered... Win32 has WaitForMultipleObjects. IS there anything > similar for DSP/BIOS? No, you can wait only for single objects (i.e for LCK, SEM or MBX). You can also create your own synchronisation mechanism by using atomic functions (ATM) or by using TSK_disable/TSK_enable/TSK_yield and simple counters. Take care Gabor --------------- Gabor Kruchio Sonorys Technology GmbH www.sonorys.at Industriestr. 1 tel: +43 2262 71071 262 A-2100 Korneuburg fax: +43 2262 71071 100 Austria/Europe |
|
Reply by ●December 13, 20012001-12-13
At 03:58 AM 12/13/01, KRUCHIO Gabor wrote: > > I'd like to have a thread block unless one of two semaphores were > > triggered... Win32 has WaitForMultipleObjects. IS there anything > > similar for DSP/BIOS? > >No, you can wait only for single objects (i.e for LCK, SEM or MBX). > >You can also create your own synchronisation mechanism by using >atomic functions (ATM) or by using TSK_disable/TSK_enable/TSK_yield >and simple counters. Can you use a single semaphore with multiple processes releasing it? If so, you could write multiple small processes which each wait on a single semaphore but all release a common semaphore. Your target process could then be waiting for that single common semaphore. Will this work? Rick Collins Arius - A Signal Processing Solutions Company Specializing in DSP and FPGA design http://www.arius.com 4 King Ave 301-682-7772 Voice Frederick, MD 21701-3110 301-682-7666 FAX |
Reply by ●December 14, 20012001-12-14
Keep in mind: - DSP/BIOS semaphores (SEM) are counter semaphores (not event semaphores) - There ase some restrictions in calling SEM_pend (e.g. within ISR/IDL) - in DSP/BIOS not only tasks (TSK) but ISR handlers are "thread of execution", too (see: HWI/SWI) - DSP/BIOS,s lock object (LCK) can be an alternative of SEM, but with restrictions Gabor > > > I'd like to have a thread block unless one of two semaphores were > > > triggered... Win32 has WaitForMultipleObjects. IS there anything > > > similar for DSP/BIOS? > > > >No, you can wait only for single objects (i.e for LCK, SEM or MBX). > > > >You can also create your own synchronisation mechanism by using > >atomic functions (ATM) or by using TSK_disable/TSK_enable/TSK_yield > >and simple counters. > > Can you use a single semaphore with multiple processes > releasing it? If so, > you could write multiple small processes which each wait on a single > semaphore but all release a common semaphore. Your target > process could > then be waiting for that single common semaphore. Will this work? > Rick Collins > > Arius - A Signal Processing Solutions Company > Specializing in DSP and FPGA design http://www.arius.com > 4 King Ave 301-682-7772 Voice > Frederick, MD 21701-3110 301-682-7666 FAX > |