Alaska Software Inc. - Threads....
Username: Password:
AuthorTopic: Threads....
JosepThreads....
on Fri, 16 Jan 2004 09:48:44 +0100
Hello,

first of all congratulations for the good job.

Now, I have a problem debuggin threads.
My menu executes a function that opens a new thread and launch a code block:

MyThread( &("{|| SayHello()}") )

function MyThread( bFunc )
    local oThread, xResult
    oThread := Thread():new()
    oThread:start(bFunc)
    xResult := oThread:Result
 return xResult

function SayHello()
    msgbox("Hello")
return nil

Then, I put a breakpoint inside SayHello(), and when this function executes
I don't get back to the debuger and the aplication hangs. The VX functions
ok, but the aplication no
Sometimes I get the control in the breakpoint, but I'm unable to reproduce
it.

There are some special care to debug this ? Maybe I forget something ?

Thanks for the help

Josep
Andreas Herdt Re: Threads....
on Fri, 16 Jan 2004 10:52:07 +0100
Josep wrote:
> Hello,
> 
> first of all congratulations for the good job.
> 
> Now, I have a problem debuggin threads.
> My menu executes a function that opens a new thread and launch a code block:
> 
> MyThread( &("{|| SayHello()}") )
> 
> function MyThread( bFunc )
>     local oThread, xResult
>     oThread := Thread():new()
>     oThread:start(bFunc)
>     xResult := oThread:Result
>  return xResult
> 
> function SayHello()
>     msgbox("Hello")
> return nil
> 
> Then, I put a breakpoint inside SayHello(), and when this function executes
> I don't get back to the debuger and the aplication hangs. The VX functions
> ok, but the aplication no
> Sometimes I get the control in the breakpoint, but I'm unable to reproduce
> it.
> 
> There are some special care to debug this ? Maybe I forget something ?

The first problem is that your function MyThread can exit prior SayHello 
can be executed. Add the line

     oThread:synchronize( 0 )

to function MyThread and the sample works as expected.

I could not reproduce a hangup of VX.........

> Thanks for the help
> 
> Josep
> 
> 
> 


Regards
   Andreas Herdt
   [Alaska Research & Development]
JosepRe: Threads....
on Fri, 16 Jan 2004 12:43:33 +0100
Hello Andreas,

sorry but this doesn't help.

> > function MyThread( bFunc )
> >     local oThread, xResult
> >     oThread := Thread():new()
> >     oThread:start(bFunc)
> >     oThread:synchronize(0)
> >     xResult := oThread:Result
> >  return xResult

I put a breakpoint in oThread:synchronize(0) but I never arrive here. Seems
that there are no return
from oTread:start(bFunc), ( in this case I have a breakpoint in SayHello() )
The VX always work ok, but in this case no var tooltip is present if I put
the cursor over one.
And if I put a :syncronize(0), my menu doesn't respond until I close
SayHello() this behaviour is
incorrect for me, thus I want to open more than one instance of SayHello()
(MDI app)


Thanks

Josep




"Andreas Herdt" <andreas.herdt@alaska-research.com> escribi en el mensaje
news:coHCJfB3DHA.2012@S15147418...
> Josep wrote:
> > Hello,
> >
> > first of all congratulations for the good job.
> >
> > Now, I have a problem debuggin threads.
> > My menu executes a function that opens a new thread and launch a code
block:
> >
> > MyThread( &("{|| SayHello()}") )
> >
> > function MyThread( bFunc )
> >     local oThread, xResult
> >     oThread := Thread():new()
> >     oThread:start(bFunc)
> >     xResult := oThread:Result
> >  return xResult
> >
> > function SayHello()
> >     msgbox("Hello")
> > return nil
> >
> > Then, I put a breakpoint inside SayHello(), and when this function
executes
> > I don't get back to the debuger and the aplication hangs. The VX
functions
> > ok, but the aplication no
> > Sometimes I get the control in the breakpoint, but I'm unable to
reproduce
> > it.
> >
> > There are some special care to debug this ? Maybe I forget something ?
>
> The first problem is that your function MyThread can exit prior SayHello
> can be executed. Add the line
>
>      oThread:synchronize( 0 )
>
> to function MyThread and the sample works as expected.
>
> I could not reproduce a hangup of VX.........
>
> > Thanks for the help
> >
> > Josep
> >
> >
> >
>
>
> --
> Regards
>    Andreas Herdt
>    [Alaska Research & Development]
>
Till WarwegRe: Threads....
on Fri, 16 Jan 2004 14:24:00 +0100
"Josep" <jborrell.nospam@central.aplitec.com> wrote in message
news:dhrqvSC3DHA.2016@S15147418...
> Hello Andreas,
>
> sorry but this doesn't help.
(...)

Josep,

okay. In this case, we'll have to dig deeper. Could you
please post your project (or a working example) so
that we can have a look at it?

Regards,
  Till Warweg

--
---------------------------------------------------
ARD - Alaska Research & Development

Web:       http://www.alaska-research.com
Investors: http://www.alaska-research.com/tifund
E-Mail:    mailto:till.warweg@alaska-research.com
Contact:   mailto:info@alaska-research.com
---------------------------------------------------
JosepRe: Threads....
on Fri, 16 Jan 2004 16:49:25 +0100
Hello Till,

for the moment see the attached project.xpj. I'm working in a little example
to test, but is dificult
to extract it from my big application.

Thanks for your attention

Josep


"Till Warweg" <till.warweg@alaska-research.com> escribi en el mensaje
news:uLlteVD3DHA.2164@S15147418...
> "Josep" <jborrell.nospam@central.aplitec.com> wrote in message
> news:dhrqvSC3DHA.2016@S15147418...
> > Hello Andreas,
> >
> > sorry but this doesn't help.
> (...)
>
> Josep,
>
> okay. In this case, we'll have to dig deeper. Could you
> please post your project (or a working example) so
> that we can have a look at it?
>
> Regards,
>   Till Warweg
>
> --
> ---------------------------------------------------
> ARD - Alaska Research & Development
>
> Web:       http://www.alaska-research.com
> Investors: http://www.alaska-research.com/tifund
> E-Mail:    mailto:till.warweg@alaska-research.com
> Contact:   mailto:info@alaska-research.com
> ---------------------------------------------------
>
>
>




PROJECT.XPJ
Till WarwegRe: Threads....
on Mon, 19 Jan 2004 10:13:44 +0100
"Josep" <jborrell.nospam@central.aplitec.com> wrote in message
news:vbuA#bE3DHA.2016@S15147418...
> Hello Till,
>
> for the moment see the attached project.xpj. I'm working in a little
example
> to test, but is dificult to extract it from my big application.

An idea: what happens with the thread samples that come with Xbase++
(worms.exe, coffee.exe), do you also have this problem with these?

In case it's too difficult or time-consuming to extract a working sample,
would it be possible to send your complete application? If that's an
option, please contact me via private e-mail at
till.warweg@alaska-research.com.

Thanks,
  Till

--
---------------------------------------------------
ARD - Alaska Research & Development

Web:       http://www.alaska-research.com
Investors: http://www.alaska-research.com/tifund
E-Mail:    mailto:till.warweg@alaska-research.com
Contact:   mailto:info@alaska-research.com
---------------------------------------------------