Multi-threading and the MVC Framework

When writing an MVC application, what multi-threading issues might there be?  If I let users only be logged in once, doesn't that solve any threading issues?

I'm new to this but want to solve problems before they bite me.

I'm interested in hearing your thoughts and experiences with Multi-threading and the MVC Framework.


Thanks,
newbieweb
newbiewebSr. Software EngineerAsked:
Who is Participating?
 
CodeCruiserCommented:
Multithreading is useful when you need to do some task which would required some processing and may lock the user interface while doing that task. For example, in my CRM project, when an error occurs, i send an email to myself with the details of the error. I do this in a separate thread because if i do this in the main program, it would freeze the UI for a few seconds while the email is relayed.
0
 
CodeCruiserCommented:
It depends on what sort of multithreading you are to do. Does it involve any common in memory structures or variables?
0
 
newbiewebSr. Software EngineerAuthor Commented:
I hadn't planned on doing any.  But wondered if it was something I needed to consider doing.

When can you imagine the need for multi-threading?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
newbiewebSr. Software EngineerAuthor Commented:
right. I need that.

Are there preferred methods of using multi-threading with the MVC Framework?
0
 
CodeCruiserCommented:
I dont know of any such preference. Clearly you would stay within the bounds of model view controller. I mean if you start a thread in the view, it should not directly access the controller or model etc.
0
 
Tony McCreathTechnical SEO ConsultantCommented:
I'm a little confused with your question.

An MVC is a single user application so I don't understand where the multiple users loging in is part of it?

Is there a database or some common data storage involved?

Regarding MVC, multithreading normally relates to worker process being used so that the GUI does not freeze while work is being done.
0
 
newbiewebSr. Software EngineerAuthor Commented:
No, I meant that if I restrict users to logging in, they won't be running multiple versions of the website against the same data/user profile.

I'll need to play with threading in the coming weeks.

Thanks,
newbieweb
0
 
Tony McCreathTechnical SEO ConsultantCommented:
I just read that microsoft now has an ASP.Net MVC framework, so you are talking about websites, which are multithreaded.

By multithreading, I believe you are talking about 2 seperate people logging in as the same user and accessing the same data. This is not what first comes to mind with software developers!

Your login idea will work. You would need to keep track of all currently logged in users and block logins for users on the list. Maybe by using a static collection


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.