realbasic-nug
[Top] [All Lists]

Re: Semaphore

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Semaphore
From: Jaap Cammeraat <realbasic at isticky dot net>
Date: Sat, 30 Jun 2007 20:16:33 +0200
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <DC0576DE-0186-472A-8D4E-7E629B6E7A74 at isticky dot net> <80C8D466-8715-4E17-81C0-0E177C69BCAD at declareSub dot com> <28B99BF6-E443-4319-8A19-CB97D1924C0D at isticky dot net> <987E9A58-5193-4176-8FA8-3723B7FF6727 at declareSub dot com>
On a window:

when pressing a button
        a method is called
                during executing row by row of code
                        one special timer on the window is set in mode 2
                                the timer will do something
                                after doing it has to tell the main method: i'm 
ready with running
                        another special timer on the window is set in mode 2
                                the timer will do something
                                after doing it has to tell the main method: i'm 
ready with running


Everything is within 1 window.



Op 30-jun-2007, om 20:00 heeft Charles Yeomans het volgende geschreven:

>
> On Jun 30, 2007, at 1:45 PM, Jaap Cammeraat wrote:
>
>> I've several processes on a Window and they have to wait on results.
>> Doing loops with consume to much processpower.
>>
>> But about the .Signal again!
>> The second .Signal will wait until a release is done,  thats right
>> isn't it?
>
> You're calling it from the same thread as the first wait.Signal.  If
> that blocked execution of that thread, how would you call Release
> from that thread?
>
>
> I'm not sure what you mean by "processes" -- do you mean threads,
> methods, ...?
>
> Charles Yeomans
>
>
>>
>>
>>
>> Op 30-jun-2007, om 18:10 heeft Charles Yeomans het volgende
>> geschreven:
>>
>>>
>>> On Jun 30, 2007, at 7:40 AM, Jaap Cammeraat wrote:
>>>
>>>> Hi All,
>>>>
>>>> I'm using a semaphore to stop executing some code but it isn't
>>>> working.
>>>> Am I doing something stupid?
>>>
>>> Yes; you're using a Semaphore incorrectly :)
>>>
>>>>
>>>> ---
>>>> wait=new Semaphore
>>>> wait.Signal     // lock this thing
>>>> wait.Signal     // try to lock again
>>>> Beep     // you will never make sound unless there is somewhere
>>>> a .Release
>>>> ---
>>>>
>>>> In my App this code will run and make a sound.
>>>> There is no .Release of this semaphore in my code.
>>>
>>>
>>> Probably what you want is to use app.SleepCurrentThread or
>>> something.  If you could explain the problem you're trying to solve,
>>> perhaps we can suggest a solution.
>>>
>>> Charles Yeomans

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

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>