Solved

threads in c/c++

Posted on 2000-05-03
10
191 Views
Last Modified: 2010-04-02
Is thread  possible in C/C++?? if so how??
0
Comment
Question by:prasen120998
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 5

Expert Comment

by:pitonyak
ID: 2776046

Look up _beginthread depending on the compiler that you use it will probably be similar to

_beginthread(pointer_to_func_to_run, NULL, stackSize, Handle);

What system and compiler are you using?

I have used this on linux, windows, and OS/2.


0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2776156
If you want , i can send you simple full example using threads in c/c++ for
windows(write you EMail).
0
 
LVL 1

Expert Comment

by:xutao
ID: 2776176
0
 
LVL 1

Expert Comment

by:xutao
ID: 2776178
0
 

Expert Comment

by:forza
ID: 2776459
If you're using Linux then try Pthreads!
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 3

Accepted Solution

by:
Iexpert earned 50 total points
ID: 2777207
Use a standard interface so you can port you threading software
around various platforms.

The best available at the moment is pthreads which is available
on Linux & Win32 etc.

The Win32 port of pthreads is @ http://sourceware.cygnus.com/pthreads-win32/

Just search the www for pthreads and you should find
loads of tutorial/reference material.
0
 

Expert Comment

by:forza
ID: 2777368
Yes pthreads works in Windows too...
I'm using pthreads myself with Linux on my dual Celeron and it's just great.

Here's a good link: http://www-rcd.cc.purdue.edu/Paragon/Docs/Intel/Manuals/psug/psug_52.html
0
 

Expert Comment

by:jpalmeroesteban
ID: 2862938
if the operating system has threads is possible that he has an api
0
 

Author Comment

by:prasen120998
ID: 3023107
Comment accepted as answer
0
 

Author Comment

by:prasen120998
ID: 3023108
Thanks others also, for their valuable comments...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now