Using functions from LR DLL's

46 views
Skip to first unread message

dushkin

unread,
Jan 20, 2010, 5:03:28 AM1/20/10
to LoadRunner
Hi guys,
Hope you will be able to help me.

I am trying to import functions from iRun50.dll and create my own DLL
which will use these functions for a certain task.

The problem is that it is a periodic task, so I created a thread
(also tried before a timer) from which I am calling the imported
functions. But nothing works there. If I am using the functions
outside the thread - they work!. But I must use them from insde a
thread or a timer message handler.

My DLL is called from a regular LR script from within the Action
procedure, and the DLL is built in VS2008.

Many thanks!

James Pulley

unread,
Jan 21, 2010, 4:55:45 PM1/21/10
to lr-loa...@googlegroups.com
This is a "call hp" type question.

pablomar

unread,
Jan 22, 2010, 10:23:40 AM1/22/10
to lr-loa...@googlegroups.com
I didn't understand

where are you creating the thread ? inside one of your own dll functions ? and from one of that functions your are calling a LR function ?

what do you mean with "nothing works there" ? absolutely nothing happens ? do you have any error ? did you check the system logs ? any crash ?




--
You received this message because you are subscribed to the Google "LoadRunner" group.
To post to this group, send email to LR-Loa...@googlegroups.com
To unsubscribe from this group, send email to
LR-LoadRunne...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/LR-LoadRunner?hl=en

Floris Kraak

unread,
Jan 22, 2010, 11:23:12 AM1/22/10
to lr-loa...@googlegroups.com
On Fri, Jan 22, 2010 at 4:23 PM, pablomar
<pablo.dani...@gmail.com> wrote:
> I didn't understand
> where are you creating the thread ? inside one of your own dll functions ?
> and from one of that functions your are calling a LR function ?
> what do you mean with "nothing works there" ? absolutely nothing happens ?
> do you have any error ? did you check the system logs ? any crash ?
>

The problem is that he is calling an external DLL that creates a
thread from within loadrunner. The fact that he runs into trouble
there does not surprise me: The entire load generator infrastructure
is designed around the idea that Loadrunner manages the threads, not
you yourself. It sounds like the type of thing that is just bound to
create problems.

However, since I have never tried this or seen this kind of setup
before I have no advice to offer other than "just don't do that then"
or "call HP" like Pulley says.


Regards,
Floris
---
'What does it mean to say that one is 48% slower? That's like saying
that a squirrel is 48% juicier than an orange - maybe it's true, but
anybody who puts the two in a blender to compare them is kind of
sick.'
--- Linus Torvalds

dushkin

unread,
Jan 22, 2010, 3:21:42 PM1/22/10
to LoadRunner
Hi Floris and all the other kind guys.

I understood your answers.

Maybe I would explain the procedure better:

I wrote a DLL with visual studio 2008. This DLL exports a function
which uses Irun50.dll exported functions to do certain task.
My load engineer calls my DLL function from his Load Runner script.
The reasoning for this work was to allow a parallel task to be
executed along with the LR script.
Since this task should be a parallel and periodic I had to build a
thread with a while(true) and a Sleep (or Think Time) inside the
thread function.

Is it helpful?

Thanks!

pablomar

unread,
Jan 22, 2010, 4:04:15 PM1/22/10
to lr-loa...@googlegroups.com
ok, thanks
as Floris said, manage your own threads inside loadrunner's threading is dangerous

but experimentations is good :-), so let's try to solve it. Do you have any kind of error message (either in loadrunner or in the windows event logs) ?

does it fails on VUgen ? on the LoadGenerator with only 1 vuser ? with more than 1 ?



pablomar

unread,
Jan 22, 2010, 4:08:55 PM1/22/10
to lr-loa...@googlegroups.com
"I had to build a
thread with a while(true) and a Sleep (or Think Time) inside the
thread function.
"

are you sure you are getting out of your loop ? or it remains there forever ?

dushkin

unread,
Jan 24, 2010, 9:21:25 AM1/24/10
to LoadRunner
Hi Pablo.

1. I didn't get nothing on the logs.
2. I am not getting out of the loop and that is by design, but because
I launched a thread, my function returned immediately after it so the
LR script could run ahead.
3. Anyway, we decided to quit those efforts and try to run a parallel
LR script instead.

Thanks!

On Jan 22, 11:08 pm, pablomar <pablo.daniel.marti...@gmail.com> wrote:
> "I had to build a
> thread with a while(true) and a Sleep (or Think Time) inside the
> thread function."
>
> are you sure you are getting out of your loop ? or it remains there forever
> ?
>
> On Fri, Jan 22, 2010 at 4:04 PM, pablomar

> <pablo.daniel.marti...@gmail.com>wrote:


>
> > ok, thanks
> > as Floris said, manage your own threads inside loadrunner's threading is
> > dangerous
>
> > but experimentations is good :-), so let's try to solve it. Do you have any
> > kind of error message (either in loadrunner or in the windows event logs) ?
>
> > does it fails on VUgen ? on the LoadGenerator with only 1 vuser ? with more
> > than 1 ?
>

> > On Fri, Jan 22, 2010 at 3:21 PM, dushkin <talt...@gmail.com> wrote:
>
> >> Hi Floris and all the other kind guys.
>
> >>  I understood your answers.
>
> >>  Maybe I would explain the procedure better:
>
> >>  I wrote a DLL with visual studio 2008. This DLL exports a function
> >> which uses Irun50.dll exported functions to do certain task.
> >>  My load engineer calls my DLL function from his Load Runner script.
> >>  The reasoning for this work was to allow a parallel task to be
> >> executed along with the LR script.
> >>  Since this task should be a parallel and periodic I had to build a
> >> thread with a while(true) and a Sleep (or Think Time) inside the
> >> thread function.
>
> >>  Is it helpful?
>
> >> Thanks!
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> "LoadRunner" group.
> >> To post to this group, send email to LR-Loa...@googlegroups.com
> >> To unsubscribe from this group, send email to

> >> LR-LoadRunne...@googlegroups.com<LR-LoadRunner%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages