• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript calls thread safe?

 
Kevin Baker
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a vendor that I'm working with and I decompiled there Applet code because it is having issues locking up the browser and not performing correctly. They seem to have multiple Applets calling JavaScript and using it to synchronize on an action. This looks like a timing issue waiting to happen but I don�t know much about how Applets execute or how Applets interface with JavaScript. Can someone give me some insight on this; because I�m not even 100% sure it is an issue but is smells like one?

Thanks in advance

Example

Applet 1:
JSObject.call("syc1()")

JScript

function syc1()
{
flag1= true;
if(flag1 and flag2 and flag3)
{
do something
}
}


Applet 2:
JSObject.call("syc2()")

function syc2()
{
flag2= true;
if(flag1 && flag2 && flag3)
{
do something
}
}

Applet 3:
JSObject.call("syc3()")

function syc3()
{
flag3= true;
if(flag1 && flag2 && flag3)
{
do something
}
}
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't really call this "synchronization". Something should happen once all 3 applets have finished doing their part, whatever that is. Looks more like a notification mechanism. Barring more information, I'd consider this uncritical.
 
Kevin Baker
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once all applets are loaded they call the JavaScript and then these functions call another common JavaScript function that unhides a layer that contains some buttons. I just figured if for some reason the Applets executed strangely the layer would be accessed simultaneously maybe causing the browser to hang. After reading about how the LiveConnect Pipeline works I agree this shouldn't be an issue.

Thanks
Kevin Baker
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic