JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java 新手區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 thread static synchronized method
Wayne





發文: 82
積分: 0
於 2015-06-15 03:37 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我溫習thread static synchronized的時候,因著以下情況,

since different "lock" of the 2 threads thus it means they can access the same of static field.
because 2 threads may using different of "this" from the instance to call the non-static method and also allow to access the static field .

所以建議以下,

[static field] access by [static synchronized method]
[non-static field] access by [non-static synchronized method]

我反覆地溫了,依然不太了解,如各大大可有例指點更佳.

謝謝


reply to postreply to post
作者 Re:thread static synchronized method [Re:Wayne]
Wayne





發文: 82
積分: 0
於 2015-06-24 03:28 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
推一下,請賜教.

reply to postreply to post
» JWorld@TW »  Java 新手區

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8