Click here to Skip to main content
14,299,406 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all, I'm working on POS device with ARM CPU.

My problem is that this device is mono-task processing and I need multiple applications to run at the same time on this device.

In other words, I need to simulate multi-threading, because there's no native support for concurrent threads to run on the given platform.

Can somebody help me to solve this?

Thanks ;)
Updated 7-Dec-09 1:37am
Rate this:
Please Sign up or sign in to vote.

Solution 3

I presume that the platform that you're deploying your programs at least has a timer facility?!

In which case, you can virtualise threads by having each of the task as a separate function and run them on a scheduling algorithm (round robin is the simplest) in response to the timer event.

But then you'll need to save the state of each such virtual thread (execution state of the functions) before preempting them and that isn't going to be an easy task, given the limitations of the platform you're working on. Sometimes, this may be near impossible.

If you achieve this, there would come complexities like managing tasks that are time-critical, assigning priorities, etc.,

Not to mention what would happen if a function deadlocks or hangs - your program would get into a definitely irrecoverable state, damaging the saved state of other virtual threads as well (because all you have is one single thread, and it's hung somewhere). Not a pleasant thing, if you ask me.

I'd try and convince my manager to use a platform that provides me with some sort of concurrent threading support instead. Seriously!
Rate this:
Please Sign up or sign in to vote.

Solution 1

Exactly what does all Operating Systeme, named multi-threading.

What do you mean by this?
Rate this:
Please Sign up or sign in to vote.

Solution 2

In all operating system, we can run different application at same time.
But there's no OS on my POS system, so for have diffrent application run at same time, I should creat an algorithm to manage diffrent task run at sane time.
Rate this:
Please Sign up or sign in to vote.

Solution 4

Thank you for your answer !
So if you say, I'd not try to use multi-threading, but I want to say that this device will not run more than 2 or 3 application.
The RFID card reader should always be available and every hour, device will use GPRS to send stored data to data center.At this moment I want to have reader available and sending GPRS data at same time.
Do you think, managing these two processes will be difficult?
Rate this:
Please Sign up or sign in to vote.

Solution 5

Whatever I thought, I've already told you. Managing anything more than 1 will bring in all sort of complexities for you to work on, because the platform wasn't designed to do it. Kindly use the message board below to create a discussion.

Click on "Post an answer", only if you're posting an answer to the query!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100