| |

VerySource

 Forgot password?
 Register
Search
View: 1227|Reply: 5

How to solve the synchronization problem in javascript! !! !!

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-2 16:50:01
| Show all posts |Read mode
Recently encountered during development, a function is called by multiple execution processes, and the memory is released after use. I would like to ask how to perform an exclusive access to an object in javascript.
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-7 11:36:01
| Show all posts
Can only be accessed by operating system processes
I say a method for reference only
Initialize a variable var buffer_ = null ;, when entering this function,
if (typeof (buffer _) == null) int buffer_ = 0;
if (buffer _ == 1) return;
else
.....
Finally, set buffer_ = 0 before exiting the function;
Haha, don't know if it helps
Reply

Use magic Report

1

Threads

14

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 United States

Post time: 2020-1-8 22:27:02
| Show all posts
No need, javascript is not a multi-threaded language
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-9 02:18:01
| Show all posts
After the call is completed, it is set to null, so don't worry about that much?
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-21 12:45:01
| Show all posts
"youbl (Waterside): After the call is completed, it will be set to null, so don't worry about that much?"

What does lz mean? Is it just a procedure call?
Reply

Use magic Report

2

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-27 13:30:01
| Show all posts
Class ID
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list