16,015,414 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Abhinav_007 (Top 9 by date)
Abhinav_007
11-Feb-14 14:07pm
View
Deleted
I'm sorry for not providing a full explanation. Here is what I was trying to achieve in my project:
(1) The ChickenFarm uses a pricing model to calculate the chicken price. If the new price is lower than the previous price, it emits an event and calls the event handlers in the retailers that have subscribed to the event.
(2) A Retailer evaluates the price, generates an OrderObject (consisting of multiple values), and sends the order to the Encoder to convert the order object into a plain string.
(3) The Encoder converts the object into a string.
(4) The Encoder sends the encoded string back to the caller.
(5) The Retailer sends the encoded string to one of the free cells in the MultiCellBuffer.
(6) The ChickenFarm receives the encoded string from the MultiCellBuffer and sends the string to the Decoder for decoding.
(7) The Decoder sends the OrderObject to the ChickenFarm. The decoded object must contain the same values generated by the Retailer.
(8) The ChickenFarm creates a new thread to process the order;
(9) The OrderProcessingThread processes the order, e.g., checks the credit card number and calculates the amount.
(10) The OrderProcessingThread sends a confirmation to the retailer and prints the order.
Now, the chickenOnSale(int p) method inside Retailer class is printing the Chicken price and then releasing the no. of retailers or threadcount which is 8 in this case.
But I'm not able to figure out what is causing the semaphore exception.When I run the program, it executes for sometime and then semaphore exception is encountered. Please have a look again and give your inputs SA.
Abhinav_007
9-Feb-14 23:43pm
View
Deleted
I'm really sorry not to mention the line.
This is the line: retailSem1.Release(threadCount);
This line is under Retailer Class inside the following method: public void chickenOnSale(int p)
Semaphore is used to check the threadcount variable which in turn is the allocated buffer space. Please see the main for the initialized value.
Thanks
Abhinav_007
31-Mar-13 3:49am
View
Tried that too. Same result. The page is just getting refreshed again and again. Is the toolkit that I'm using is proper or not??
Abhinav_007
21-Mar-13 8:29am
View
Sir, actually i'll be inputting source, destination and the timezone(asp radio button) and as soon as i click get direction button(asp button), It shoud show me the output.
Abhinav_007
21-Mar-13 8:21am
View
Yes sir. In the first place i'm not able to call this function using a an asp radio button in a switch case. Meaning I simply don't know how to do that.
Abhinav_007
21-Mar-13 8:11am
View
can you please show that with an example.
It would be really helpful.
Abhinav_007
21-Mar-13 7:59am
View
I want to add a switch case which will take input from asp radio button list which will take this javascript function and give output depending on the different departure time mentioned.
Currently the timestamp mentioned is for morning 9:00 am.
Abhinav_007
21-Mar-13 4:04am
View
Thanks for the info. I didn't know that. Will keep that in mind.
Abhinav_007
21-Mar-13 3:28am
View
Meaning using the image as a background and then placing all the asp controls over it.
Show More