473,769 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

running multiple threads and multiple processes at the same time

Hi,

I currently trying to implement a simulation banking system as part of an
assigment. I must stress i do not want line by line code to complete this,
what i'm really after is a guide to how i would go about doing this.

I need to read a customer from the file customer_list, into a fifo queue,
every Ts time. (where Ts is expressed in seconds).

Whilst this is happening i also need to have 3 tellers, who when a customer
enters the queues, a free teller grabs the customers and processes there
request, which takes Ts time. (as before). If no customer, teller sleeps.

From thinking about this, I have come up what i believe is the best way to
go.

I think i should create one process that runs the customerInsert( ) routine,
and then three processes one for each teller ( running the Teller() routine)

Now, the problem that i have is i have never coded in C before. I am quite
well versed in Java, however. Therefore my first question is whats the best
way to start coding this? and secondly, how do i code this ?? Is there C
API DOCS like Java has ??

Thanks in advance,

Matt
Nov 14 '05 #1
1 1798
On Tue, 18 May 2004 00:04:25 +0800, "Smegly" <sm****@eftel.n et.au>
wrote:
I think i should create one process that runs the customerInsert( ) routine,
and then three processes one for each teller ( running the Teller() routine)
What for? I'll just do a big loop, each loop is 1 unit of time
(depending on what your question requires). Every loop I do...

Wait, this is very /Off Topic/ here. Try comp.programmin g or some
newsgroups concerned with algorithms.
Now, the problem that i have is i have never coded in C before. I am quite
well versed in Java, however. Therefore my first question is whats the best
way to start coding this? and secondly, how do i code this ?? Is there C
API DOCS like Java has ??


You want threads and stuff, you must look at your platform specific
newsgroups. Standard portable C (which this newsgroup is concerned)
has no API per se, if you mean it the way Java does (drawing buttons,
widgets and all that stuff). Check the C compiler you are using. There
should be some docs.
Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3410
by: Michael Schmitt | last post by:
Hello. What is the usual way for running functions in parallel on a multiple-processor machine. Actually I want to run a single computationally expensive function with different parameter sets. Running the functions in different threads doesn't seem to work, because of the global interpreter lock. Would it help to fork processes, which run the single function with a given parameter set? Is there any simple way, how this forked worker...
9
23084
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated to a pool. If I assign only one application to a applicaton pool and have multiple worker processes assigned to that pool. Will my application be processed by many worker processes?
5
2493
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for this execution... we need immediate execution of all notification processes and would prefer to spawn multiple instances generating emails at one time. Solution ? I took a look at threading, and at first it looked to be the answer.
4
1977
by: Gregory Gadow | last post by:
I've cobbled together a PrinterClass that takes a text file and dumps it to a printer. The app using is has multiple threads, all of which need access to a shared instance. Can someone point me to an example of multiple threads synchronized to use a single shared resource? -- Gregory Gadow
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.