B4J Question About Threads and Modules.

Discussion in 'B4J Questions' started by vfafou, Apr 5, 2015.

  1. vfafou

    vfafou Active Member Licensed User

    Erel somewhere says that the code into code modules is executed in the main thread of the application.
    My question is: where is executed the code of the code modules called from a thread of a multithreaded application? In the main thread or in the thread called it?

    Thank you in advance!
  2. billzhan

    billzhan Active Member Licensed User

    Guess it's about b4j server.

    See thread and Erel's answers (in post #4)
    [WebApp] Chatroom - Threads, Sessions and Server events

  3. vfafou

    vfafou Active Member Licensed User

    Thank you for your reply billzhan!
    Yes, it's about B4J Server!

    "Unless it is explicitly written that the event runs on a different thread"

    How could I write that the event runs on a different thread?

    Any help is highly appreciated!
  4. Erel

    Erel Administrator Staff Member Licensed User

    What I meant is that unless it is explicitly documented in the libraries documentation then the events run on the main thread.

    You can use the Threading library to create background threads. Though in most cases it will only make your solution more complicated and fragile.
    lemonisdead likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice