Xojo Conferences
XDCMay2019MiamiUSA

Single-threaded semaphore (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Extends bug?
Next thread: Coordinates of selstart


Win32 API Declares   -   Berg, Heath
  Single-threaded semaphore   -   Paul Rodman
   Re: Single-threaded semaphore   -   Frank Bitterlich
   Re: Single-threaded semaphore   -   Mark Lubratt
   Re: Single-threaded semaphore   -   Adam Ernst
   Re: Single-threaded semaphore   -   Paul Rodman

Single-threaded semaphore
Date: 30.01.05 01:23 (Sat, 29 Jan 2005 16:23:58 -0800)
From: Paul Rodman
I have a single-threaded app that's using a serial port. It would
seem that when serial data arrives, the DataAvailable event can fire
at any time, even while another method is executing (sort of like an
"interrupt"). This causes problems for me since the DataAvailable
data is inserted into a queue which I might be fiddling with at the
time of the "interrupt".

Any ideas for a single-threaded semaphore-like way of preventing this?

Paul Rodman
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Single-threaded semaphore
Date: 02.02.05 18:06 (Wed, 2 Feb 2005 18:06:31 +0100)
From: Frank Bitterlich
I think using #pragma DisableBackgroundTasks will do the job.

Cheers,
Frank+++

Am 30.01.2005 um 01:23 schrieb Paul Rodman:

> I have a single-threaded app that's using a serial port. It would seem
> that when serial data arrives, the DataAvailable event can fire at any
> time, even while another method is executing (sort of like an
> "interrupt"). This causes problems for me since the DataAvailable data
> is inserted into a queue which I might be fiddling with at the time of
> the "interrupt".
>
> Any ideas for a single-threaded semaphore-like way of preventing this?
>
> Paul Rodman

Re: Single-threaded semaphore
Date: 30.01.05 01:32 (Sat, 29 Jan 2005 18:32:23 -0600)
From: Mark Lubratt
CriticalSection?

Mark

On Jan 29, 2005, at 6:23 PM, Paul Rodman wrote:

> I have a single-threaded app that's using a serial port. It would seem
> that when serial data arrives, the DataAvailable event can fire at any
> time, even while another method is executing (sort of like an
> "interrupt"). This causes problems for me since the DataAvailable data
> is inserted into a queue which I might be fiddling with at the time of
> the "interrupt".
>
> Any ideas for a single-threaded semaphore-like way of preventing this?
>
> Paul Rodman
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Single-threaded semaphore
Date: 30.01.05 02:43 (Sat, 29 Jan 2005 19:43:29 -0600)
From: Adam Ernst
Or how about a timer? I believe they only fire when no other code is.
Just set a timer's mode to 1 in the DataAvailable event.

Adam

On Jan 29, 2005, at 6:32 PM, Mark Lubratt wrote:

> CriticalSection?
>
> Mark
>
> On Jan 29, 2005, at 6:23 PM, Paul Rodman wrote:
>
>> I have a single-threaded app that's using a serial port. It would
>> seem that when serial data arrives, the DataAvailable event can fire
>> at any time, even while another method is executing (sort of like an
>> "interrupt"). This causes problems for me since the DataAvailable
>> data is inserted into a queue which I might be fiddling with at the
>> time of the "interrupt".
>>
>> Any ideas for a single-threaded semaphore-like way of preventing this?
>>
>> Paul Rodman

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Single-threaded semaphore
Date: 30.01.05 19:19 (Sun, 30 Jan 2005 10:19:48 -0800)
From: Paul Rodman
>From: Adam Ernst <<email address removed>>
>Or how about a timer? I believe they only fire when no other code is.
>Just set a timer's mode to 1 in the DataAvailable event.

Now why didn't I think of that??? Works great! Thanks.

>On Jan 29, 2005, at 6:32 PM, Mark Lubratt wrote:
>
>> CriticalSection?

Unfortunately, that's only for multi-threaded apps too.

> >
>> Mark
>>
>> On Jan 29, 2005, at 6:23 PM, Paul Rodman wrote:
>>
>>> I have a single-threaded app that's using a serial port. It would
>>> seem that when serial data arrives, the DataAvailable event can fire
>>> at any time, even while another method is executing (sort of like an
>>> "interrupt"). This causes problems for me since the DataAvailable
>>> data is inserted into a queue which I might be fiddling with at the
>>> time of the "interrupt".
>>>
> >> Any ideas for a single-threaded semaphore-like way of preventing this?

Paul Rodman
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>