LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-25-2006, 12:10 AM   #1
arunka
Member
 
Registered: Mar 2005
Posts: 60

Rep: Reputation: 15
Threads inside shared library


hi all..
can we create threads inside a shared library??

Thanks in advance
Arun KA
 
Old 02-25-2006, 12:54 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Yes, definitely.

Unix/Linux .so shared libraries don't have a DllMain() or any other notion of "state" - so there's no problem whatsoever.

Windows .dll shared libraries have some issues, but generally threading isn't any more or less an issue with .dll-based code than any other code, even on Windows.

Here are a couple of worthwhile links on Linux shared libraries:
http://yolinux.com/TUTORIALS/Library...ndDynamic.html
http://www.tldp.org/HOWTO/Program-Library-HOWTO/

'Hope that helps .. PSM

PS:
"Creating threads inside a shared library" probably isn't the best way to think about it. Basically, "it's just code" - you have exactly the same concurrency and data protection issues regardless of whether the linkage is from a .o object, a .a static library, or dynamically loaded at runtime from a .so. This is particularly true for Linux, and it's "mostly true" for Windows.

Last edited by paulsm4; 02-25-2006 at 12:57 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in printing inside shared libary pihu Programming 1 01-14-2006 10:10 AM
Where can I get every shared library at? Balkman Linux - General 2 08-28-2004 10:56 PM
help shared library jingle_mj Linux - Newbie 1 08-13-2004 04:36 PM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
Finding The Shared Printers Inside A Network johnapril28 Linux - Networking 0 10-03-2003 01:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration