TI Basic multitasking (TI-84+) - basic

Within the TI basic in calculator programming, (not the the external programming), is it possible to create a multitask? Like the calculator would be able to run two threads or codes at a time?
I just found results of multithreading within the external programming of a TI calculator. Otherwise I couldn't find any about the ti calculator. So im asking if it is possible to multitask.

No, you cannot run multiple threads of code at the same time with TI-basic. With an OS or shell, like KnightOS or MirageOS, you can run multiple programs at the same time I believe, but that's probably not what you need.

Related

Multithreading in Embedded Systems

I am confused about the following:
I am hoping to get a job in the field of embedded systems. However, every interview I've had seems to end up with a conversation about threads in C and how to do thread-safe programming
My question is how do I go about learning multithreading in embedded systems? Are they the same as POSIX threads? For example, the tasks in FreeRTOS. Are they same thing as pthreads?
Can someone give me some tips on what to do and where to start?
Every OS has it's own threads/task/processes characteristics.
Despite the differences, the methods to synchronize, guard and interchange data between those, are roughly the same.
If someone knows that you don't know a specific OS, invited you to an interview - he/she probably expects you to answer in general and not to be OS specific.
You can solve any problem with POSIX (or any other) tool-set in mind and to mention that migration of the solution to a non-POSIX environment will keep same logic with some minor adaptations.
Multithreading concept is almost same everywhere, whether in RTOS or Linux.
The difference is in the operational behavior.
My question is how do I go about learning multithreading in embedded
systems?
My suggestion is to first learn and understand the concepts of multithreading by referring some online material, you can practice by writing some simple codes on your desktop running any flavor of Linux.
The go for some advanced topics like synchronization mechanism using Semaphore and Mutexes, you will then get to learn about the basic concept of when to use a semaphore and when to use a mutex for thread synchronization.
Then move to some Embedded Targets and try out some code using uCOS-II/uCOS-III or FreeRTOS.
Are they the same as POSIX threads?
No, they are not exactly same, POSIX thread library is a bit advance and is highly portable on different OS. For e.g. a multithread code written on Linux using pthread can also be compiled and executed on Windows with little or no change.
On the other hand, a thread implementation on RTOS is different, threads in RTOS are treated as tasks and they start executing only when a call to start the scheduler is made.
From my own experience trying to find learning resources, I found the the FreeRTOS docs very useful. They have both a reference manual as well as the Mastering the FreeRTOS Kernal doc which includes code snippets and covers topics such as task management, software timers, resource management, and general thread safe programming techniques. I dont think this would be the best place to start out, but once you've familiarized yourself with basics the other answers and comments have mentioned, this could help with the next step of learning by doing.

How to make an replacement for qnx sin command?

I am currently working on a project which involves porting a huge application from QNX SRR to Standard Linux using POSIX commands
Currently I am stuck on the sin command that QNX implements.
Can someone guide me as to how an alternate for qnx sin be created in Linux
The application code uses sin in a lot of places to find process ids, kill processes, restart processes etc. So intention is to create a replacement for sin without really making too many changes in the application code
The best way to proceed is to analyze exactly what sin options you use. Making a fully functioning sin replacement is a lot of work -- it can be done, but it may turn out that you only need a small percentage of the commands.
The simplest way to proceed is to create a front-end for sin that correctly interprets the options that are actually used in your system.
Then, based on those options, issue the equivalent linux commands via the system() call.

General questions about and to better understand programming

I am new to that website and to programming, and so to Python and Linux. The thing is I do not just want to learn how to program but I also want to learn how the entire system of a computer (a computer ecosystem) works.
I have plenty of questions like how and why do you do an IDE? How do you do a terminal, console? How do you do a operating system? How do you merge two programming languages together? What is a multi-paradigm programming languages and how do you do them? Like what is a paradigm to start with?
For now those are basically my questions that I have. Maybe it isn't appropriate for your site or for certain of you but for those that they find this as not is place here, where does this belong? And yes I am clueless but everyone started clueless.
if you have any sites, or books, or even videos to where I could learn all this or diagrams that could help me anyhow; it would really be appreciated.
Thank you.
I would first start with a good Youtube video that I saw the other day about how to build your own CPU. Its a very basic CPU that doesn't have much processing power but it gives you a good idea of how the CPU in a computer operates.
http://www.youtube.com/watch?v=cNN_tTXABUA
Then with that knowledge I would learn assembly (Opcodes) to see how the CPU computes & moves ones and zeros around the bus system.
http://www.teach-ict.com/as_as_computing/ocr/H447/F453/3_3_8/features/miniweb/index.htm
After you learn assembly you can start to see the bigger picture of how a language compiler works such as (gcc & g++).
Basically an OS (such as Linux) uses 99% C as it's primary language. Linux is a very complex system made up of many different server processes. Terminal is the name Mac OS uses and Bash is the name that Linux uses. Bash is just a program written so that the user can interact with the Kernel.

python 3 IDLE progressbar/loadingbar

I am using the standard IDE that comes with python3.
I would like to make use of the backspace function (\b) within the ILE in order to create a NICE LOOKING progressbar. Even a simple percentage counter requires the backspace function.
When I run the script I get a wonderfully useless symbol instead of a backspace.
Questions:
How can I use \b in the IDE
How else can I make a progress bar that would use something similar to a backspace (in other words, I don't want a lame eg: loading:##########################
I've read threads on this and the best solution I've heard involves actually re-writing the IDE base code which is just an tkinter app. I just don't understand why this would be required ... did they think it was a stupid feature to have a function like this in the standard python IDE? Mind-baffling
It sounds to me like you want a 'GUI' (often pronounced 'gooey') widget. That stands for Graphical User Interface. Python normally runs in a Text-Base Interface aka command-line interface (CLI). CLI applications are the sort of boring 1980s style terminal things that they had around before they invented the computer mouse and invented better graphics devices. If you want a progress bar to look modern (my interpretation of 'not lame'), you will have to create a GUI. Python can do this too, if you use special tools. You need a GUI framework. Some good GUI frameworks are listed here. Different frameworks are like different tools. I would recommend using tk and ttk for starters (TKinter and themed TKinter), and you can get that version of the progressbar here.
So actually implementing GUIs is always a mess. It is really complicated and very difficult to program. That is the value of the boring 1980s style CLI terminal applications is that they are much simpler to program.
If you still decide you want a GUI app, you should check out a tutorial or maybe even a GUI-builder. See this stack overflow thread and this website.

How to automatically run in the background?

I'm not sure that it's not implemented yet, I hope that it is. But I know that in .Net programmers should manually run time-consuming task in the background thread.
So every time we handle some UI event and we understand that this will take some time we also understand that this will hang UI thread and our application. And then we make all this Background work things and handle callbacks or whatever.
So my question is:
Is there in some language/platform a mechanism that will automatically run time-consuming tasks in the background and will do all related work itself? So we just write the code for handling specific UI event and this code will be somehow detected as time-consuming and will be executed in background.
And if there isn't, then why?
There's been a lot of work done in Haskell (and other functional languages) to make it automatically do things in other threads. But Haskell's not the easiest GUI programming language.
You could look at something like Quartz for .Net. It's a job scheduler, but can be used to run time consuming processes in a background thread.
There is active research being done in this area, but it's a complex topic. For one example, see the Axum project by MS Research. It's a message-passing based DSL targetting the CLR.
I am not aware of any UI-specific languages, however. Most large frameworks (including .NET) have lots of tools for assisting the process of running tasks in the background.
There is not (as far as I know) and the reason for that is because the computer doesn't know ahead of time how long a certain task will take to complete. Make no mistake - a computer algorithm can be devised in particular cases by the programmer to determine the expected duration of a certain specific task - but at this time there is no way known to make a computer determine just how long any arbitrary task will take. This is a consequence of a very important Computer Science problem, called the Halting Problem.

Resources