Multi Thread in Servoy plugin

Hello Everybody,

I want to create a servoy plugin where I need to create multiple thread in java inside that plugin.

Please help me to know, is it possible/allowed to run multiple thread inside a servoy plugin.
If it is possible then please give me the way to handle it

Thanks

Get a good book on Java concurrency first (multi threading in Java is not the easiest thing to do but the easiest thing to do wrong), then have a look at the my plugins tutorials on ServoyForge: Overview - Servoy-Stuff Tutorials - ServoyForge. You will have all you need :)

Hi Patalbot,

Thanks for your reply.

  • I have already went through your plugins tutorial and also I have created few plugins.

  • But the requirement for the new plugin is some how different.

  • In my new plugin I am using a java library to complete my task, but I found some of the methods
    of java library are creating new threads, which shows that indirectly we are going to create multiple
    thread inside the new plugin.

  • When I tested the new plugin by calling one of the java library method(“creating new thread”) then I got the below error :
    and then the servoy developer stopped working.
    [attachment=0]multiThreadError.png[/attachment]

  • To test the effect of creation of new thread inside the plugin, I created below plugin method and called it from servoy and in this case also I got the above error.

  • public void js_createNewThread(){*
  • Thread th = new Thread(“thread1”);*
  • th.start();*
  • }*
  • I think above error is due to the creation of new thread/multiple thread inside the servoy plugin .

So, please share your thoughts :)

just making a new thread shouldn’t cause your program to completely kill itself. That is quite weird.

Hi jcompagner,

You are right, multi-threading is not a problem.

I think, I found the problem but not the solution for it. :?: :?:

I am using a external java library(“.jar”) for my plugin. ( INFO:- " This external java library has power to access dll files of operating system")

Servoy developer stopped working in the below situation :

  • When I am trying to access a simple plugin method by keeping the external java library in correct place.
  • In this situation, I am not trying to access any method of java library from plugin’s method

Servoy developer working fine in the below situation :
When I am trying to access a simple plugin method by removing the external java library.

So, is there any problem in the external java library.

What library? How can we know if there is a problem with that "external java library’ if you don’t say what it is?
Have you looked into the servoy_log.txt?