Link to home
Start Free TrialLog in
Avatar of shankarraj
shankarraj

asked on

multithreading in C++ using solaris

Hi,

I would like to generate a program which will be used by multiple clients at a time. For this, I would go for a multithreading program. Please explain me this with some simple examples.

Thanks,
shankarraj
Avatar of trinitrotoluene
trinitrotoluene
Flag of Australia image

I assume you know what multithreading means.....
Check out

www.sun.com/software/whitepapers/solaris9/multithread.pdf
developers.sun.com/solaris/library/topics/index.jsp

let me know if you need more help
Multithreading is closely related to operating system. So, which one are you using?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany 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
oops, sorry, I didn't see the "using solaris" in the title.

@jkr,
 have you any comment about this question?
https://www.experts-exchange.com/questions/22975992/Problem-in-marshaling-win-api-findfirstfile-please-help.html?cid=238
SOLUTION
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
I can also strongly recommend this book...

http://www.oreilly.com/catalog/multithread/

Although it is specific to Win32 programming it does a very good job of discussing all the pitfalls of multi-threaded programming and various design patterns you can adopt to try and avoid them. Most of these principles migrate well to Unix (although the primitives used to achieve them don't).
you might want to refer the following VxWorks APIs, you will ofcourse need to look only at the specific multithreading APIs

http://www.slac.stanford.edu/exp/glast/flight/sw/vxdocs/vxworks/OS_Libraries.htm
The kind of problems you can run into with MT programming: -

http://en.wikipedia.org/wiki/Priority_inversion
http://en.wikipedia.org/wiki/Deadlock
http://en.wikipedia.org/wiki/Race_condition

I don't mean to be all doom and gloom, I just want to make sure you know what pain you are potentially letting yourself in for :)

On the up-side, it when it's going well it can be a lot of fun !!!

-Rx.
It's also worth looking at Boost threads. It provides a nice abstract C++ object model for multi-threaded programming that is cross-platform...

http://www.boost.org/doc/html/thread.html
>>I would like to generate a program which will be used by multiple clients at a time.
I presume that now that you have got an idea of what multithreading means and how ito use it in Solaris, What excatly are you looking for? Are you making a chat server and client? or are you making multithreaded server which cater to different clients at a time?
Best Regards,
DeepuAbrahamK
SOLUTION
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