Link to home
Start Free TrialLog in
Avatar of martie
martie

asked on

parallel programming concept

If I am gonna write a library, which has a base class...this base class will be inherited by many other classes in the main application. But only one thread will call object of this class, or the object which inherited this class...Do I need to add some thread synchronization mechanism to this  base class?
i.e.
a)FS_MyGenericClass is the generic class
b)FS_MyDerivedClass is the inherited class
But there will be many FS_MyDerivedClass running concurrently on their own threads

Also, please give me some URLs for materials about this kind of question as i am gonna write a thread-safe library, which has many generic classes.

Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

it depends on what the generic classes do

you have to provide synchronization when your class accesses shared resources; for example if your base class accesses a file you may want to use synchronization to ensure only one thread writes at a time.

your question is very vauge you will need to provide some examples of exactly what you are doing

Paul
ASKER CERTIFIED SOLUTION
Avatar of ambience
ambience
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dear martie

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to split between  

     "ambience, ALexNek, makerp"

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: https://www.experts-exchange.com/commspt/


PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner