473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Implement Multi Threading in C & kill the remaining Threads when you come out of any

i dont have i dea about multithreading in c... please help me
Nov 22 '14 #1
2 1997
donbock
2,426 Expert 2GB
There are two issues: thread management (which is OS dependent); and writing thread-safe code.

Thread-safe code. To begin with, try to use only automatic and dynamically-allocated variables - avoid static/global variables. The topic is quite a bit more complicated but this is a good first step.
Nov 22 '14 #2
weaknessforcats
9,208 Expert Mod 8TB
What OS are you using?

If it's Windows, get a copy of Windows via C/C++ and read the chapter on multi threading.

Once you have done that, post again and I will provide some sample Windows code.
Nov 24 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Garry Hodgson | last post by:
a colleague of mine has seen an odd problem in some code of ours. we initially noticed it on webware, but in distilling a test case it seems to be strictly a python issue. in the real system, it...
1
by: amit | last post by:
Hello, I am embedding a python script in a C++ application. The script can be called simultaneously from multiple threads. What is the correct way to implement this situation: 1) Have...
77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
3
by: Manuel | last post by:
I've playing around with multi-threading applications lately. The main problem I have is that when I create a file/table/whatever I need a unique name. The only way I could come up with, is asking...
2
by: 1944USA | last post by:
I am re-architecting a C# application written as a multithreaded Windows Service and trying to squeeze every bit of performance out of it. 1) Does the thread that an object is instantiated on...
5
by: Coaster | last post by:
I am designing a process which will spawn a good number of threads and some of them will execute a c++ process which is quite memory intensive (although not multithreaded). This will run on a 2 cpu...
0
ammoos
by: ammoos | last post by:
hi friends pls help me.. i got an assignment which i feel very difficult to me.. i dont have more knowledge about multi-threading in .net... the assignment details is below.... pls help me... i...
14
by: Akihiro KAYAMA | last post by:
Hi all. I found cooperative multi-threading(only one thread runs at once, explicit thread switching) is useful for writing some simulators. With it, I'm able to be free from annoying mutual...
5
by: George Maicovschi | last post by:
As multi-threading is not built in PHP I've been using a hack letting the Apache server handle the multi-threading issues, but I'm really curious of other approaches to this issue. If anyone has...
1
by: koti688 | last post by:
Hello Mates i need suggetions / help on this problem. we are doing a online Backup/ Restore Diaster recovery Solution. For that till now , we have implemented Synchronous Data Transfer model...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.