Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DLL and threads  RSS feed

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://download-llnw.oracle.com/javase/6/docs/api/java/io/FileWriter.html

A DLL can be used by several applications at the same time.

Thread share the resource,Anyone can give me examples of DLL files that are used by several threads at same time?
 
Henry Wong
author
Sheriff
Posts: 22837
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DLL, or Dynamic Link Libraries, when loaded, become part of the application. Threads don't need to do anything special to share them, that is different than using any other (static) library -- it will just make method calls to a class that will make native calls.

Henry
 
Javin Paul
Ranch Hand
Posts: 295
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:DLL, or Dynamic Link Libraries, when loaded, become part of the application. Threads don't need to do anything special to share them, that is different than using any other (static) library -- it will just make method calls to a class that will make native calls.

Henry



Hi Henry

Can you please elaborate above point , what exactly is the difference using any other (static ) library ?

Thanks
Javin
 
Stephan van Hulst
Saloon Keeper
Posts: 6980
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static libraries are built into the program when it compiles. Dynamic libraries are separate and are loaded into memory as part of the program when it runs.
 
Javin Paul
Ranch Hand
Posts: 295
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Stephan , I know the difference between Static library and Dynamic library .

Just wondering any difference in terms of Java Thread behavior in case of Static or Dynamic library?

as per my knowledge Java Thread should behave identically in both cases.

Thanks
Javin
 
Stephan van Hulst
Saloon Keeper
Posts: 6980
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Behaviour should be identical regardless of the language.

A library, whether static or dynamic, will behave as if you copied its code directly into your own. Any variables it references will be part of your program, and if the code in the library isn't synchronized, you will have to synchronize it yourself if you plan on working with threads.

You don't have to worry about other programs accessing a dynamic library while you're working with it as well, because each program has its own copy of variables.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that the quote in the original post doesn't come from the linked page -- not sure where it comes from or why the link is there.
 
abalfazl hossein
Ranch Hand
Posts: 635
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!