java - Singleton service solves multi-process writing files
天蓬老师
天蓬老师 2017-05-17 10:01:08

Now we need a multi-process file writing program

If you write directly, you need to ensure that the process locks the file handle

Now I want to register a singleton writing service through spring

When multiple programs write files, they request the spring interface to write files

Is this solution feasible?

Or use a singleton RPC service?

A single instance can ensure that it is an instance when writing a file, avoiding multi-thread and multi-process synchronization problems!

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!