Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reinier Maas
GHC
Commits
a5bad3d2
Commit
a5bad3d2
authored
2 years ago
by
Duncan Coutts
Committed by
Marge Bot
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Split up the CapIOManager content by I/O manager
Using the new IOMGR_ENABLED_<name> CPP defines.
parent
1a8f020f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rts/IOManager.c
+39
-11
39 additions, 11 deletions
rts/IOManager.c
rts/IOManager.h
+14
-16
14 additions, 16 deletions
rts/IOManager.h
with
53 additions
and
27 deletions
rts/IOManager.c
+
39
−
11
View file @
a5bad3d2
...
...
@@ -211,15 +211,30 @@ void initCapabilityIOManager(CapIOManager **piomgr)
(
CapIOManager
*
)
stgMallocBytes
(
sizeof
(
CapIOManager
),
"initCapabilityIOManager"
);
#if defined(THREADED_RTS)
#if !defined(mingw32_HOST_OS)
iomgr
->
control_fd
=
-
1
;
switch
(
iomgr_type
)
{
#if defined(IOMGR_ENABLED_SELECT)
case
IO_MANAGER_SELECT
:
iomgr
->
blocked_queue_hd
=
END_TSO_QUEUE
;
iomgr
->
blocked_queue_tl
=
END_TSO_QUEUE
;
iomgr
->
sleeping_queue
=
END_TSO_QUEUE
;
break
;
#endif
#else // !defined(THREADED_RTS)
iomgr
->
blocked_queue_hd
=
END_TSO_QUEUE
;
iomgr
->
blocked_queue_tl
=
END_TSO_QUEUE
;
iomgr
->
sleeping_queue
=
END_TSO_QUEUE
;
#if defined(IOMGR_ENABLED_WIN32_LEGACY)
case
IO_MANAGER_WIN32_LEGACY
:
iomgr
->
blocked_queue_hd
=
END_TSO_QUEUE
;
iomgr
->
blocked_queue_tl
=
END_TSO_QUEUE
;
break
;
#endif
#if defined(IOMGR_ENABLED_MIO_POSIX)
case
IO_MANAGER_MIO_POSIX
:
iomgr
->
control_fd
=
-
1
;
break
;
#endif
default:
break
;
}
*
piomgr
=
iomgr
;
}
...
...
@@ -376,12 +391,25 @@ void markCapabilityIOManager(evac_fn evac USED_IF_NOT_THREADS,
CapIOManager
*
iomgr
USED_IF_NOT_THREADS
)
{
#if !defined(THREADED_RTS)
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
blocked_queue_hd
);
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
blocked_queue_tl
);
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
sleeping_queue
);
switch
(
iomgr_type
)
{
#if defined(IOMGR_ENABLED_SELECT)
case
IO_MANAGER_SELECT
:
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
blocked_queue_hd
);
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
blocked_queue_tl
);
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
sleeping_queue
);
break
;
#endif
#if defined(IOMGR_ENABLED_WIN32_LEGACY)
case
IO_MANAGER_WIN32_LEGACY
:
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
blocked_queue_hd
);
evac
(
user
,
(
StgClosure
**
)(
void
*
)
&
iomgr
->
blocked_queue_tl
);
break
;
#endif
default:
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
rts/IOManager.h
+
14
−
16
View file @
a5bad3d2
...
...
@@ -190,27 +190,25 @@ bool is_io_mng_native_p (void);
*/
typedef
struct
{
#if defined(THREADED_RTS)
#if !defined(mingw32_HOST_OS)
/* Control FD for the MIO manager for this capability */
int
control_fd
;
#if defined(IOMGR_ENABLED_SELECT)
/* Thread queue for threads blocked on I/O completion. */
StgTSO
*
blocked_queue_hd
;
StgTSO
*
blocked_queue_tl
;
/* Thread queue for threads blocked on timeouts. */
StgTSO
*
sleeping_queue
;
#endif
#else // !defined(THREADED_RTS)
/* Thread queue for threads blocked on I/O completion.
* Used by the select() and Win32 MIO I/O managers. It is not used by
* the WinIO I/O manager, though it remains defined in this case.
*/
#if defined(IOMGR_ENABLED_WIN32_LEGACY)
/* Thread queue for threads blocked on I/O completion. */
StgTSO
*
blocked_queue_hd
;
StgTSO
*
blocked_queue_tl
;
#endif
/* Thread queue for threads blocked on timeouts.
* Used by the select() I/O manager only. It is grossly inefficient, like
* everything else to do with the select() I/O manager.
*
* TODO: It is not used by any of the Windows I/O managers, though it
* remains defined for them. This is an oddity that should be resolved.
#if defined(IOMGR_ENABLED_MIO_POSIX)
/* Control FD for the (posix) MIO manager for this capability,
*/
StgTSO
*
sleeping_queue
;
int
control_fd
;
#endif
}
CapIOManager
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment